Example--
I dunno if all my parentheses match or not, but I believe this will work:
fileMenu.addMenuListener (
new MenuListener () {
public void menuSelected (MenuEvent e) {
if (((JMenuItem)((JMenu)e.get
/// do stuff here
}
}
// other MenuListener functions here
}
);
Main Topics
Browse All Topics





by: VolatileVoidPosted on 2005-04-12 at 07:28:35ID: 13762574
You're gonna want to add MenuListeners to each of the menus above. Once you do, find out which of the JMenuItems is selected (getSelectedObjects)