shortcut « Menu « Java Swing Q&A





1. How to add JMenuBar shortcuts?    stackoverflow.com

Adding shortcuts to JMenuBar submenu items in the Java Swing GUI designer is obvious, but how are shortcuts added to JMenuBar main menu items?

2. How to make Java TrayIcon MenuItem shorcut?    stackoverflow.com

I have difficulty to make a shortcut on TrayIcon popup menu. Followings are my codes.

final PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon = new TrayIcon(createImage("images/bulb.gif", "tray icon"));
final SystemTray tray = SystemTray.getSystemTray();

//MenuItem aboutItem ...