pendulumx
asked on
Java Swing : Updating screen to show new listbox contents
Hi. This is a newbie question.
I have a simple Java program with Swing. An extract:
listData = new Vector();
listData.add("Hello there");
listData.add("hihi");
listbox1 = new JList( listData );
...
midSection.add(listbox1, BorderLayout.CENTER);
This works, and it displays the contents of the vector in the Listbox on the screen just fine.
The problem is when a button is pressed, the listData vector gets modified. How can I make the listbox "update" to show the new contents?
Thanks
I have a simple Java program with Swing. An extract:
listData = new Vector();
listData.add("Hello there");
listData.add("hihi");
listbox1 = new JList( listData );
...
midSection.add(listbox1, BorderLayout.CENTER);
This works, and it displays the contents of the vector in the Listbox on the screen just fine.
The problem is when a button is pressed, the listData vector gets modified. How can I make the listbox "update" to show the new contents?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER