This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMenubar/Jmenu/JMenuItem does not work

 
ishan dave
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't got any listeners associated with any menu items.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and you seem to have two JMenuBars.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic