• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JComboBox problem

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic