This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JComboBox problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JComboBox problem " Watch "JComboBox problem " New topic
Author

JComboBox problem

Deepa Raghuraman
Greenhorn

Joined: Nov 26, 2001
Posts: 13
hi,
I have a combobox.. it contains a list of value.... when any one item selected, the whole list get change.. i have used action listener to perform this operation...
but i have a problem with it... when i change the items in the combo box, again the action listener is triggered..
i want the event to trigger only when user selects an item in the list..
which listener to use.. i tried with itemlistener.. still the problem remain the same..
i have used thread in my program, so that the screen doesnt look hanging.. Is it becoze of the thread?
Thanks in advance.
regards,
Deepa Raghuraman
indian greenhorn
Greenhorn

Joined: May 01, 2003
Posts: 16
Hi,
When u select an item from the combobox u are making the list to change according to item selected. Right?
After u select the item and before you add the changed list of items to the combobox just remove the actionlistener. After updating the comboxbox with new items now again add the actionlistener. This will solve the problem you are having.
regards,
Krish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JComboBox problem
 
Similar Threads
Question about JCombobox
Change Skin on Partial Submit
JList - Null Pointer Exception
JCombo and its listeners
Repopulating form problem