Computing.Net > Forums > Programming > JAVA-itemStateChanged executing????

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

JAVA-itemStateChanged executing????

Reply to Message Icon

Name: Jason Humphries
Date: October 3, 2002 at 16:31:25 Pacific
OS: Windows XP Pro
CPU/Ram: 331/192
Comment:

Whenever is use a JComboBox with itemStateChanged and use it to simply open a JOptionPane or JFrame displaying the String of the item selected, it always executes the code twice and displays the extra window twice. can anybody please help me out?



Sponsored Link
Ads by Google

Response Number 1
Name: tod
Date: October 10, 2002 at 06:43:17 Pacific
Reply:

it's a common problem. whne the combo box is initialising the status change event is fired once. then again when an action is made on the combo box i.e a selection.

if you create the combo, add a listener then populate the combo with data. you will generate the change event.

without seeing your code the only other thing is to insure initialisation is done in an order that will not generate the event.


0
Reply to Message Icon

Related Posts

See More


exec and STDIN (Perl Ques... Visual C++



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: JAVA-itemStateChanged executing????

Java applet execute system command www.computing.net/answers/programming/java-applet-execute-system-command/5867.html

Java to executables www.computing.net/answers/programming/java-to-executables/389.html

Java sql server procedure problem www.computing.net/answers/programming/java-sql-server-procedure-problem/11989.html