Daviyow Posted March 22, 2014 Share 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. Link to comment Share on other sites More sharing options...
Kenneh Posted March 22, 2014 Share Posted March 22, 2014 It's list.addElement(object); 1 Link to comment Share on other sites More sharing options...
Daviyow Posted March 22, 2014 Author Share Posted March 22, 2014 It's list.addElement(object); addElement is not in there.. its not seeing it as a DefaultListModel Link to comment Share on other sites More sharing options...
Kenneh Posted March 22, 2014 Share 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 Link to comment Share on other sites More sharing options...
Daviyow Posted March 22, 2014 Author Share 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.. :| Link to comment Share on other sites More sharing options...
Kenneh Posted March 22, 2014 Share Posted March 22, 2014 Looks neater but still cant find addElement.. :| On the model. 1 Link to comment Share on other sites More sharing options...
Daviyow Posted March 22, 2014 Author Share Posted March 22, 2014 On the model. Wups my bad lots of love my mate! Link to comment Share on other sites More sharing options...
Kenneh Posted March 22, 2014 Share Posted March 22, 2014 Wups my bad lots of love my mate! No problem ;) 1 Link to comment Share on other sites More sharing options...
Daviyow Posted March 22, 2014 Author Share Posted March 22, 2014 (edited) No problem NVM fixed this to thanks man Edited March 23, 2014 by daviyow Link to comment Share on other sites More sharing options...