This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Why ItemListener does not respond to the events fired by JMenuItem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Why ItemListener does not respond to the events fired by JMenuItem." Watch "Why ItemListener does not respond to the events fired by JMenuItem." New topic
Author

Why ItemListener does not respond to the events fired by JMenuItem.

Abhimanyus singh
Greenhorn

Joined: Apr 11, 2012
Posts: 27
Hi..Guys

I'm developing a short program,consisting of a menu...but the problem comes the moment I try to register an item-listener with a MenuItem.I don't understand why does this happen, for in the tutorials it is written that, ItemEvents are fired by the components that implement the ItemSelectable interface,that applies with the JMenuItem class.
All goes well if I use ActionListener in place of ItemListener....

Help!!!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
works fine for JMenuItems that are selectable - JCheckBoxMenuItem, JRadioButtonMenuItem
Abhimanyus singh
Greenhorn

Joined: Apr 11, 2012
Posts: 27
Michael Dunn wrote:works fine for JMenuItems that are selectable - JCheckBoxMenuItem, JRadioButtonMenuItem



thanks...!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why ItemListener does not respond to the events fired by JMenuItem.
 
Similar Threads
how to create a search engine?
AWT/Swing Event Threads vs SWT - Rob?
This should be simple
about JMenu
JMenu