aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JMenubar/Jmenu/JMenuItem does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JMenubar/Jmenu/JMenuItem does not work" Watch "JMenubar/Jmenu/JMenuItem does not work" New topic
Author

JMenubar/Jmenu/JMenuItem does not work

ishan dave
Ranch Hand

Joined: Apr 16, 2007
Posts: 39
Dear friends,

I am facing a problame in using jmenu in my swing application. I am using netbeans5.5 for developing the form now in this form i attach a menubar and in menu bar 3 menues file, new form and exit. now when some one click on the exit menu the application should be exited. if new form menu clicked then some stuff and if he clicks file then again i give two menu items new form and exit. but none of these works can any one please guide me.


regards,
ishan dave
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
You haven't got any listeners associated with any menu items.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
. . . and you seem to have two JMenuBars.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
. . . Don't try adding an exit menu to the JMenuBar; add a JMenuItem of that name, or add the exit item to the "File" Menu.
Make sure it has its ActionListener set up. Don't add ActionListeners to JMenus, but JMenuItems.
 
jQuery in Action, 2nd edition
 
subject: JMenubar/Jmenu/JMenuItem does not work