Advertisement

12.02.2007 at 11:20AM PST, ID: 22996319
[x]
Attachment Details

Java Swing : Updating screen to show new listbox contents

Asked by pendulumx in Java AWT & Swing

Tags: java, listbox, swing

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?

ThanksStart Free Trial
1:

           
 
Keywords: Java Swing : Updating screen to sho…
 
Loading Advertisement...
 
[+][-]12.02.2007 at 02:16PM PST, ID: 20392560

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java AWT & Swing
Tags: java, listbox, swing
Sign Up Now!
Solution Provided By: objects
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628