Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes JMenu Listener? 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 "JMenu Listener?" Watch "JMenu Listener?" New topic
Author

JMenu Listener?

Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

Will this work, it didn't for me


Jesus lives
Nick Meverden
Ranch Hand

Joined: Jul 03, 2006
Posts: 59
No an ActionListener isn't going to do anything for JMenu. It would be more helpful if you tell us what your are trying to do. You want to show a dialog message when JMenu is clicked?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37900
    
  22
It seems that a JMenu doesn't fire an ActionEvent when you click it.
Try a JMenuItem instead.
Nikos Stavros
Ranch Hand

Joined: Feb 24, 2006
Posts: 243

I want a message when JMenu is clicked
Nick Meverden
Ranch Hand

Joined: Jul 03, 2006
Posts: 59
check out javax.swing.JMenu.addMenuListener()

and

javax.swing.event.MenuListener/MenuEvent API's
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMenu Listener?
 
Similar Threads
JMenu problem
Error when calling a constructor
menu in loop
How to create horizontal menus
Using ItemListener on a JMenu