Solved

Difference between ActionListener and ItemListener???

Posted on 2006-11-23
2
3,320 Views
Last Modified: 2008-01-09
anyone wanna take a shot at explaining that to me?
0
Comment
Question by:NadiaRashid
2 Comments
 
LVL 12

Expert Comment

by:enachemc
ID: 18006255
They are interface representing two types of events. For each type of event, you will have to receive with an object implementing one of the interfaces. Even if the two interfaces were completely equal in the functions declared, you would not be able to implement the second interface and register with this for the first type of event.
0
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 18006652
An ActionListener is used to listen for action events which are fired by subclasses fo AbstractButton and includes buttons checkboxes and menus (http://java.sun.com/developer/codesamples/examplets/java.awt.event/55.html)

An ItemListener is used to listen for item events which are fired by components that implement the ItemSelectable interface.These are components that maintain state -- generally on/off state for one or more items. The 1.1 AWT components that generate item events are checkboxes, checkbox menu items, choices, and lists (http://spectral.mscs.mu.edu/javadev/tutorials/TheJavaTutorial/post1.0/ui/itemlistener.html)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now