Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JComboBox problem

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Deepa Raghuraman
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic