yea, i've looked at that but i still cant seem to make it work lol
Code:
private JList nameList;
private DefaultListModel listModel;
// some code
nameList = addList(1,5,1,5); //just putting a blank list in the GUI (shows up at least)
// more code
listModel = new DefaultListModel();
String name = "";
if(buttonObj == addNameButton) // odd way of checking if the button was clicked but works =P
{
name = nameField.getText();
listModel.addElement(name);
nameList = new JList(listModel); //doesnt add anything to the list
}
so for some reason that doesnt work...havent been able to figure it out yet.
Bookmarks