This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between ItemStateChanged and ActionPerformed

 
Swela Jathar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
what is the actual difference between ItemStateChanged and ActionPerformed in case of combobox??
Should I ever use one instead of the other?
Thanks.....
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you gone through the tutorial on How to Use Combo Boxes, linked from the API for JComboBox?

The best way to understand the difference is to write code that adds both listeners to a combo box which print the method name and details of the event parameter. Then play with the combo and observe what events are fired, and when.

Also, the methods are itemStateChanged and actionPerformed. Java is case sensitive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic