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 On 3/22/2014 at 10:16 PM, Kenneh said: 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) On 3/22/2014 at 10:18 PM, daviyow said: 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 On 3/22/2014 at 10:20 PM, Kenneh said: 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 On 3/22/2014 at 10:25 PM, daviyow said: 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 3/22/2014 at 10:29 PM, Kenneh said: 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 On 3/22/2014 at 10:34 PM, daviyow said: 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) On 3/22/2014 at 10:35 PM, Kenneh said: No problem NVM fixed this to thanks man Edited March 23, 2014 by daviyow Link to comment Share on other sites More sharing options...