Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

submenu's actionevent  RSS feed

 
chinna narasappa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friend,

I am unable to connect if clicked on the submenu items it has to open like pop message window or report regarding selected submenu items,

give me solution, how to do?

Thanks & Regards
Narsappa
 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

You can add an ActionListener to a JMenuItem, exactly the same as you would to a JButton; in fact if I remember correctly JMenuItem is a subclass of AbstractButton, so it is in fact a kind of button.

[edit]Add this bit: A JMenu is also a button for the same reason.[/edit]
[ September 15, 2008: Message edited by: Campbell Ritchie ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!