• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Abhimanyus singh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works fine for JMenuItems that are selectable - JCheckBoxMenuItem, JRadioButtonMenuItem
 
Abhimanyus singh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:works fine for JMenuItems that are selectable - JCheckBoxMenuItem, JRadioButtonMenuItem



thanks...!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic