Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Difference between ActionListener and ItemListener???

Posted on 2006-11-23
2
Medium Priority
?
3,807 Views
Last Modified: 2008-01-09
anyone wanna take a shot at explaining that to me?
0
Comment
Question by:NadiaRashid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

722 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