|
For our Senior Design Project we are converting ImageJ's interface from AWT to SWING. The main problem is that we are not sure how to change MenuShortcut, or what the equivalent is in SWING. Any help would be greatly appreciated. Thanks!
Code is from Menus.java
static void addItem(Menu menu, String label, int shortcut, boolean shift) {
if (menu==null)
return;
MenuItem item;
if (shortcut==0)
item = new MenuItem(label);
else {
if (shift) {
item = new MenuItem(label, new MenuShortcut(shortcut, true));
shortcuts.put(new Integer(shortcut+200),label);
} else {
item = new MenuItem(label, new MenuShortcut(shortcut));
shortcuts.put(new Integer(shortcut),label);
}
}
if (addSorted) {
if (menu==pluginsMenu)
addItemSorted(menu, item, userPluginsIndex);
else
addOrdered(menu, item);
} else
menu.add(item);
item.addActionListener(ij);
}
|