aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes difference between ItemStateChanged and ActionPerformed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "difference between ItemStateChanged and ActionPerformed" Watch "difference between ItemStateChanged and ActionPerformed" New topic
Author

difference between ItemStateChanged and ActionPerformed

Swela Jathar
Greenhorn

Joined: Aug 19, 2011
Posts: 22
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

Joined: May 03, 2008
Posts: 4658
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
 
Consider Paul's rocket mass heater.
 
subject: difference between ItemStateChanged and ActionPerformed