(Swing) JList
JTable : Used when only 1 column is requiredPre -Req :
- Make sure Window Builder addon is installed into eclipse
- Create a New Swing Designer >app Window > Save
- In Design Mode > add a JList Component
DefaultListModel<String> listModel = new DefaultListModel<>();
listModel.addElement("USA");
listModel.addElement("India");
listModel.addElement("Vietnam");
JList list = new JList(listModel);
frame.getContentPane().add(list, "cell 0 1 7 4,grow");
No comments:
Post a Comment