Daviyow Posted March 22, 2014 Posted March 22, 2014 Hi guys, im new to GUI and i cant seem to get this working.; im trying to set my jList to model DefaultListModel so i can use list.addElement public DefaultListModel<String> availableDropsModel = new DefaultListModel(); But i cant seem to get it working help pls! Its for 2 lists and a button, 1 list should have text, and the button must pass it to the other list.
Daviyow Posted March 22, 2014 Author Posted March 22, 2014 It's list.addElement(object); addElement is not in there.. its not seeing it as a DefaultListModel
Kenneh Posted March 22, 2014 Posted March 22, 2014 (edited) addElement is not in there.. its not seeing it as a DefaultListModel I meant the model. To add your model to the list, do List list = new List(listModel); Edited March 22, 2014 by Kenneh
Daviyow Posted March 22, 2014 Author Posted March 22, 2014 I meant the model. To add your model to the list, do List list = new List(listModel); Looks neater but still cant find addElement.. :|
Kenneh Posted March 22, 2014 Posted March 22, 2014 Looks neater but still cant find addElement.. :| On the model. 1
Daviyow Posted March 22, 2014 Author Posted March 22, 2014 On the model. Wups my bad lots of love my mate!
Daviyow Posted March 22, 2014 Author Posted March 22, 2014 (edited) No problem NVM fixed this to thanks man Edited March 23, 2014 by daviyow