Solved

Difference between ActionListener and ItemListener???

Posted on 2006-11-23
2
3,384 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.

773 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