Java Code Examples for javax.swing.JMenuItem#setIcon()
The following examples show how to use
javax.swing.JMenuItem#setIcon() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JMenuPrice.java From jeveassets with GNU General Public License v2.0 | 6 votes |
public JMenuPrice(final Program program) { super(GuiShared.get().itemPriceTitle(), program); // this.setIcon(Images.SETTINGS_USER_PRICE.getIcon()); ListenerClass listener =new ListenerClass(); jEdit = new JMenuItem(GuiShared.get().itemEdit()); jEdit.setIcon(Images.EDIT_EDIT.getIcon()); jEdit.setActionCommand(MenuPriceAction.EDIT.name()); jEdit.addActionListener(listener); add(jEdit); jReset = new JMenuItem(GuiShared.get().itemDelete()); jReset.setIcon(Images.EDIT_DELETE.getIcon()); jReset.setActionCommand(MenuPriceAction.DELETE.name()); jReset.addActionListener(listener); add(jReset); }
Example 2
Source File: JMenuReprocessed.java From jeveassets with GNU General Public License v2.0 | 6 votes |
public JMenuReprocessed(final Program program) { super(TabsReprocessed.get().title(), program); setIcon(Images.TOOL_REPROCESSED.getIcon()); ListenerClass listener = new ListenerClass(); jAdd = new JMenuItem(TabsReprocessed.get().add()); jAdd.setIcon(Images.EDIT_ADD.getIcon()); jAdd.setActionCommand(MenuReprocessedAction.ADD.name()); jAdd.addActionListener(listener); add(jAdd); jSet = new JMenuItem(TabsReprocessed.get().set()); jSet.setIcon(Images.EDIT_SET.getIcon()); jSet.setActionCommand(MenuReprocessedAction.SET.name()); jSet.addActionListener(listener); add(jSet); }
Example 3
Source File: AbstractMenuFactory.java From netbeans with Apache License 2.0 | 6 votes |
private void configureMenuItem (JMenuItem item, String containerCtx, String action, ActionProvider provider, Map context) { // System.err.println("ConfigureMenuItem: " + containerCtx + "/" + action); item.setName(action); item.putClientProperty(KEY_ACTION, action); item.putClientProperty(KEY_CONTAINERCONTEXT, containerCtx); item.putClientProperty(KEY_CREATOR, this); item.setText( provider.getDisplayName(action, containerCtx)); // System.err.println(" item text is " + item.getText()); item.setToolTipText(provider.getDescription(action, containerCtx)); int state = context == null ? ActionProvider.STATE_ENABLED | ActionProvider.STATE_VISIBLE : provider.getState (action, containerCtx, context); boolean enabled = (state & ActionProvider.STATE_ENABLED) != 0; // System.err.println("action " + action + (enabled ? " enabled" : " disabled")); item.setEnabled(enabled); boolean visible = (state & ActionProvider.STATE_VISIBLE) != 0; // System.err.println("action " + action + (visible ? " visible" : " invisible")); item.setVisible(visible); item.setMnemonic(provider.getMnemonic(action, containerCtx)); item.setDisplayedMnemonicIndex(provider.getMnemonicIndex(action, containerCtx)); item.setIcon(provider.getIcon(action, containerCtx, BeanInfo.ICON_COLOR_16x16)); }
Example 4
Source File: SelectInAction.java From netbeans with Apache License 2.0 | 5 votes |
/** * Add item for an action into a submenu (it the action exists). * * @param parent Parent to add the new item into. * @param action ID of the action for {@link #getAction(String)} * @param displayName Display name for the action. */ private void addActionItem(JMenu parent, String action, String displayName) { Action a = getAction(action); if (a != null) { JMenuItem item = new JMenuItem(a); item.setText(displayName); item.setIcon(null); parent.add(item); } }
Example 5
Source File: EditorRootPane.java From libGDX-Path-Editor with Apache License 2.0 | 5 votes |
private JMenu createProjectMenu() { JMenu menu = new JMenu(MenuConsts.project); newProjectItem = new JMenuItem(MenuConsts.newProject); newProjectItem.addActionListener(menuHandler); newProjectItem.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_newProject))); menu.add(newProjectItem); openProjectItem = new JMenuItem(MenuConsts.openProject); openProjectItem.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_openProject))); openProjectItem.addActionListener(menuHandler); menu.add(openProjectItem); saveProjectItem = new JMenuItem(MenuConsts.saveProhect); saveProjectItem.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_saveProject))); saveProjectItem.addActionListener(menuHandler); menu.add(saveProjectItem); closeProjectItem = new JMenuItem(MenuConsts.closeProject); closeProjectItem.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_closeProject))); closeProjectItem.addActionListener(menuHandler); menu.add(closeProjectItem); menu.add(new JSeparator()); JMenuItem exitItem = new JMenuItem(MenuConsts.exit); exitItem.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_exit))); exitItem.addActionListener(menuHandler); menu.add(exitItem); return menu; }
Example 6
Source File: QFixMessengerFrame.java From quickfix-messenger with BSD 3-Clause "New" or "Revised" License | 5 votes |
private void initWindowMenu() { windowMenu = new JMenu("Window"); windowMenu.setMnemonic('W'); JMenuItem projectWindowMenuItem = new JMenuItem("Project Window"); JMenuItem logfileWindowMenuItem = new JMenuItem("Logfile Window"); projectWindowMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.WINDOW_ICON)); projectWindowMenuItem.setMnemonic('P'); projectWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK)); projectWindowMenuItem .addActionListener(new ProjectWindowActionListener(this)); logfileWindowMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.WINDOW_ICON)); logfileWindowMenuItem.setMnemonic('L'); logfileWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_L, InputEvent.CTRL_DOWN_MASK)); logfileWindowMenuItem .addActionListener(new LogfileWindowActionListener(this)); windowMenu.add(logfileWindowMenuItem); windowMenu.add(projectWindowMenuItem); }
Example 7
Source File: EditorRootPane.java From libGDX-Path-Editor with Apache License 2.0 | 5 votes |
private JMenu createAddBGMenu(){ JMenu menu = new JMenu(MenuConsts.bg); addBG = new JMenuItem(MenuConsts.addBG); addBG.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_addBG))); addBG.addActionListener(menuHandler); menu.add(addBG); return menu; }
Example 8
Source File: GuiMouseListener.java From WorldGrower with GNU General Public License v3.0 | 5 votes |
private void addAssignActionsToLeftMouse(JPopupMenu menu) { JMenuItem guiAssignActionsToLeftMouseItem = MenuFactory.createJMenuItem(assignActionToLeftMouseAction, soundIdReader); guiAssignActionsToLeftMouseItem.setText("Assign action to left mouse click..."); guiAssignActionsToLeftMouseItem.setIcon(IconUtils.getMouseIcon()); guiAssignActionsToLeftMouseItem.setToolTipText("Assigns an action to the left mouse button"); menu.add(guiAssignActionsToLeftMouseItem); }
Example 9
Source File: OurUtil.java From org.alloytools.alloy with Apache License 2.0 | 5 votes |
/** * Construct a new JMenuItem then add it to an existing JMenu. * * @param parent - the JMenu to add this JMenuItem into (or null if you don't * want to add it to any JMenu yet) * @param label - the text to show on the menu * @param attrs - a list of attributes to apply onto the new JMenuItem * <p> * If one positive number a is supplied, we call setMnemonic(a) * <p> * If two positive numbers a and b are supplied, and a!=VK_ALT, and * a!=VK_SHIFT, we call setMnemoic(a) and setAccelerator(b) * <p> * If two positive numbers a and b are supplied, and a==VK_ALT or * a==VK_SHIFT, we call setAccelerator(a | b) * <p> * If an ActionListener is supplied, we call addActionListener(x) * <p> * If an Boolean x is supplied, we call setEnabled(x) * <p> * If an Icon x is supplied, we call setIcon(x) */ public static JMenuItem menuItem(JMenu parent, String label, Object... attrs) { JMenuItem m = new JMenuItem(label, null); int accelMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); boolean hasMnemonic = false; for (Object x : attrs) { if (x instanceof Character || x instanceof Integer) { int k = (x instanceof Character) ? ((int) ((Character) x)) : ((Integer) x).intValue(); if (k < 0) continue; if (k == KeyEvent.VK_ALT) { hasMnemonic = true; accelMask = accelMask | InputEvent.ALT_MASK; continue; } if (k == KeyEvent.VK_SHIFT) { hasMnemonic = true; accelMask = accelMask | InputEvent.SHIFT_MASK; continue; } if (!hasMnemonic) { m.setMnemonic(k); hasMnemonic = true; } else m.setAccelerator(KeyStroke.getKeyStroke(k, accelMask)); } if (x instanceof ActionListener) m.addActionListener((ActionListener) x); if (x instanceof Icon) m.setIcon((Icon) x); if (x instanceof Boolean) m.setEnabled((Boolean) x); } if (parent != null) parent.add(m); return m; }
Example 10
Source File: JMenuUI.java From jeveassets with GNU General Public License v2.0 | 5 votes |
public JMenuUI(Program program) { super(GuiShared.get().ui(), program); setIcon(Images.MISC_EVE.getIcon()); ListenerClass listener = new ListenerClass(); jWaypoints = new JMenu(GuiShared.get().uiWaypoint()); jWaypoints.setIcon(Images.TOOL_ROUTING.getIcon()); add(jWaypoints); jStation = new JMenuItem(GuiShared.get().uiStation()); jStation.setIcon(Images.LOC_STATION.getIcon()); jStation.setActionCommand(MenuUIAction.AUTOPILOT_STATION.name()); jStation.addActionListener(listener); jWaypoints.add(jStation); jSystem = new JMenuItem(GuiShared.get().uiSystem()); jSystem.setIcon(Images.LOC_SYSTEM.getIcon()); jSystem.setActionCommand(MenuUIAction.AUTOPILOT_SYSTEM.name()); jSystem.addActionListener(listener); jWaypoints.add(jSystem); jMarket = new JMenuItem(GuiShared.get().uiMarket()); jMarket.setIcon(Images.TOOL_MARKET_ORDERS.getIcon()); jMarket.setActionCommand(MenuUIAction.MARKET.name()); jMarket.addActionListener(listener); add(jMarket); jOwner = new JMenuItem(GuiShared.get().uiOwner()); jOwner.setIcon(Images.DIALOG_PROFILES.getIcon()); jOwner.setActionCommand(MenuUIAction.OWNER.name()); jOwner.addActionListener(listener); add(jOwner); jContracts = new JMenuItem(GuiShared.get().uiContract()); jContracts.setIcon(Images.TOOL_CONTRACTS.getIcon()); jContracts.setActionCommand(MenuUIAction.CONTRACTS.name()); jContracts.addActionListener(listener); add(jContracts); }
Example 11
Source File: ActionsTest.java From netbeans with Apache License 2.0 | 5 votes |
/** * #47527 * Tests if "noIconInMenu" really will NOT push the icon from the action * to the menu item. */ public void testNoIconInMenu() throws Exception { JMenuItem item = new JMenuItem(); item.setIcon(null); Actions.connect(item, new TestNoMenuIconAction(), false); assertNull(item.getIcon()); }
Example 12
Source File: SwingUtils.java From WorldGrower with GNU General Public License v3.0 | 5 votes |
public static void setMenuIcon(JMenuItem menuItem, ImageIds imageIds, ImageInfoReader imageInfoReader) { Image image = imageInfoReader.getImage(imageIds, null); int imageWidth = image.getWidth(null); int imageHeight = image.getHeight(null); if (imageWidth > 96 || imageHeight > 96) { image = cropImage((BufferedImage)image, Math.min(imageWidth, 96), Math.min(imageHeight, 96)); } menuItem.setIcon(new ImageIcon(image)); }
Example 13
Source File: EditorRootPane.java From libGDX-Path-Editor with Apache License 2.0 | 5 votes |
private JMenu createAddPathMenu(){ JMenu menu = new JMenu(MenuConsts.path); addVertex = new JCheckBoxMenuItem(MenuConsts.addVertex); addVertex.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_addVertex))); addVertex.addActionListener(menuHandler); menu.add(addVertex); editVertex = new JCheckBoxMenuItem(MenuConsts.moveVertex); editVertex.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_editVertex))); editVertex.addActionListener(menuHandler); menu.add(editVertex); insertVertex = new JCheckBoxMenuItem(MenuConsts.insertVertex); insertVertex.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_insertVertex))); insertVertex.addActionListener(menuHandler); menu.add(insertVertex); removeVertex = new JCheckBoxMenuItem(MenuConsts.removeVertex); removeVertex.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_removeVertex))); removeVertex.addActionListener(menuHandler); menu.add(removeVertex); menu.add(new JSeparator()); clearPath = new JMenuItem(MenuConsts.clearPath); clearPath.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_clearPath))); clearPath.addActionListener(menuHandler); menu.add(clearPath); return menu; }
Example 14
Source File: FrmMain.java From MeteoInfo with GNU Lesser General Public License v3.0 | 5 votes |
public void unloadPlugin(Plugin plugin) { if (!plugin.isLoad()) { return; } this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); JMenuItem pluginMI = this.findPluginMenuItem(plugin.getName()); plugin.getPluginObject().unload(); plugin.setPluginObject(null); plugin.setLoad(false); pluginMI.setSelected(false); pluginMI.setIcon(this._unloadedPluginIcon); this.setCursor(Cursor.getDefaultCursor()); }
Example 15
Source File: EditorRootPane.java From libGDX-Path-Editor with Apache License 2.0 | 5 votes |
private JMenu createAddScreenMenu(){ JMenu menu = new JMenu(MenuConsts.screen); addScreen = new JMenuItem(MenuConsts.addScreen); addScreen.setIcon(new ImageIcon(this.getClass().getResource(ResourcesConsts.ic_menu_addScreen))); addScreen.addActionListener(menuHandler); menu.add(addScreen); return menu; }
Example 16
Source File: JMenuJumps.java From jeveassets with GNU General Public License v2.0 | 5 votes |
@Override public void updateMenuData() { removeAll(); add(jAddSelected); jAddSelected.setEnabled(!menuData.getSystemLocations().isEmpty()); add(jAddOther); add(jClear); jClear.setEnabled(!Settings.get().getJumpLocations(clazz).isEmpty()); if (!Settings.get().getJumpLocations(clazz).isEmpty()) { addSeparator(); } for (final MyLocation location : Settings.get().getJumpLocations(clazz)) { //Add to menu final JMenuItem jMenuItem = new JMenuItem(location.getSystem()); //FIXME !Jumps i18n - Clear System jMenuItem.setIcon(Images.EDIT_DELETE.getIcon()); jMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //Remove from settings Settings.get().removeJumpLocation(clazz, location); //Update Data updateJumpsData(); //Remove from asset tab removeColumn(location); //Update GUI updateJumpsGUI(); } }); add(jMenuItem); } }
Example 17
Source File: QFixMessengerFrame.java From quickfix-messenger with BSD 3-Clause "New" or "Revised" License | 4 votes |
private void initFileMenu() { fileMenu = new JMenu("File"); fileMenu.setMnemonic('F'); JMenuItem newProjectMenuItem = new JMenuItem("New Project"); newProjectMenuItem.setIcon(IconBuilder.build( getMessenger().getConfig(), IconBuilder.NEW_ICON)); newProjectMenuItem.setMnemonic('N'); newProjectMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK)); newProjectMenuItem .addActionListener(new NewProjectActionListener(this)); saveProjectMenuItem = new JMenuItem("Save Project"); saveProjectMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.SAVE_ICON)); saveProjectMenuItem.setMnemonic('S'); saveProjectMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)); saveProjectMenuItem.addActionListener(new SaveProjectActionListener( this)); saveProjectMenuItem.setEnabled(false); JMenuItem openProjectMenuItem = new JMenuItem("Open Project"); openProjectMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.OPEN_ICON)); openProjectMenuItem.setMnemonic('O'); openProjectMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK)); openProjectMenuItem.addActionListener(new OpenProjectActionListener( this)); closeProjectMenuItem = new JMenuItem("Close Project"); closeProjectMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.CLOSE_ICON)); closeProjectMenuItem.setMnemonic('C'); closeProjectMenuItem.addActionListener(new CloseProjectActionListener( this)); closeProjectMenuItem.setEnabled(false); JMenuItem importMessageMenuItem = new JMenuItem("Import Message"); importMessageMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.IMPORT_ICON)); importMessageMenuItem.setMnemonic('I'); importMessageMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_I, InputEvent.CTRL_DOWN_MASK)); importMessageMenuItem .addActionListener(new ImportMessageActionListener(this)); JMenuItem exportMessageMenuItem = new JMenuItem("Export Message"); exportMessageMenuItem.setIcon(IconBuilder.build(getMessenger() .getConfig(), IconBuilder.EXPORT_ICON)); exportMessageMenuItem .addActionListener(new ExportMessageActionListener(this)); exportMessageMenuItem.setMnemonic('X'); exportMessageMenuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK)); JMenuItem exitMenuItem = new JMenuItem("Exit"); exitMenuItem.setIcon(IconBuilder.build(getMessenger().getConfig(), IconBuilder.EXIT_ICON)); exitMenuItem.setMnemonic('x'); exitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_DOWN_MASK)); exitMenuItem.addActionListener(new FrameExitActionListener(this)); fileMenu.add(newProjectMenuItem); fileMenu.add(saveProjectMenuItem); fileMenu.add(openProjectMenuItem); fileMenu.add(closeProjectMenuItem); fileMenu.addSeparator(); fileMenu.add(importMessageMenuItem); fileMenu.add(exportMessageMenuItem); fileMenu.addSeparator(); fileMenu.add(exitMenuItem); }
Example 18
Source File: JMenuAssetFilter.java From jeveassets with GNU General Public License v2.0 | 4 votes |
public JMenuAssetFilter(final Program program) { super(GuiShared.get().addFilter(), program); ListenerClass listener = new ListenerClass(); this.setIcon(Images.TOOL_ASSETS.getIcon()); jTypeID = new JMenuItem(GuiShared.get().item()); jTypeID.setIcon(Images.EDIT_ADD.getIcon()); jTypeID.setActionCommand(MenuAssetFilterAction.ITEM_TYPE_FILTER.name()); jTypeID.addActionListener(listener); add(jTypeID); addSeparator(); jStation = new JMenuItem(GuiShared.get().station()); jStation.setIcon(Images.LOC_STATION.getIcon()); jStation.setActionCommand(MenuAssetFilterAction.STATION_FILTER.name()); jStation.addActionListener(listener); add(jStation); jPlanet = new JMenuItem(GuiShared.get().planet()); jPlanet.setIcon(Images.LOC_PLANET.getIcon()); jPlanet.setActionCommand(MenuAssetFilterAction.PLANET_FILTER.name()); jPlanet.addActionListener(listener); add(jPlanet); jSystem = new JMenuItem(GuiShared.get().system()); jSystem.setIcon(Images.LOC_SYSTEM.getIcon()); jSystem.setActionCommand(MenuAssetFilterAction.SYSTEM_FILTER.name()); jSystem.addActionListener(listener); add(jSystem); jRegion = new JMenuItem(GuiShared.get().region()); jRegion.setIcon(Images.LOC_REGION.getIcon()); jRegion.setActionCommand(MenuAssetFilterAction.REGION_FILTER.name()); jRegion.addActionListener(listener); add(jRegion); jLocations = new JMenuItem(TabsOverview.get().locations()); jLocations.setIcon(Images.LOC_LOCATIONS.getIcon()); }
Example 19
Source File: StartScreen.java From WorldGrower with GNU General Public License v3.0 | 4 votes |
private JMenuItem createMenuItem(Action action, ImageIcon imageIcon, String toolTipText) { JMenuItem menuItem = MenuFactory.createJMenuItem(action, soundIdReader); menuItem.setIcon(imageIcon); menuItem.setToolTipText(toolTipText); return menuItem; }
Example 20
Source File: MarvinEditor.java From marvinproject with GNU Lesser General Public License v3.0 | votes |
/** * Creates the menubar */ private void loadMenuBar() { menuBar = new JMenuBar(); menuHandler = new MenuHandler(); jmnFile = new JMenu("File"); jmnFile.setMnemonic('F'); menuBar.add(jmnFile); jmnEdit = new JMenu("Edit"); jmnEdit.setMnemonic('E'); menuBar.add(jmnEdit); // Load filter jmnFilters = new JMenu("Filters"); jmnFilters.setMnemonic('f'); jmnAnalyses = new JMenu("Analyse"); jmnAnalyses.setMnemonic('n'); loadPluginMenu("filters", jmnFilters, new FilterMenuItemHandler()); loadPluginMenu("analyses", jmnAnalyses, new FilterMenuItemHandler()); menuBar.add(jmnFilters); menuBar.add(jmnAnalyses); jmnHistory = new JMenu("History"); jmnHistory.setMnemonic('H'); jmiShowHistory = new JMenuItem("Show history"); jmiShowHistory.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"history.png")); jmiShowHistory.setMnemonic('S'); jmiShowHistory.addActionListener(menuHandler); jmnHistory.add(jmiShowHistory); // Menu Item New jmiNew = new JMenuItem("New"); jmiNew.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"newFile.png")); jmiNew.setMnemonic('N'); jmiNew.addActionListener(menuHandler); jmnFile.add(jmiNew); // Menu Item Open jmiOpen = new JMenuItem("Open"); jmiOpen.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"open.png")); jmiOpen.setMnemonic('O'); jmiOpen.addActionListener(menuHandler); jmnFile.add(jmiOpen); // Menu Item Save jmiSave = new JMenuItem("Save"); jmiSave.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"save.png")); jmiSave.setMnemonic('S'); jmiSave.addActionListener(menuHandler); jmnFile.add(jmiSave); // Menu Item Save As jmiSaveAs = new JMenuItem("Save As..."); jmiSaveAs.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"saveas.png")); jmiSaveAs.setMnemonic('a'); jmiSaveAs.addActionListener(menuHandler); jmnFile.add(jmiSaveAs); // Menu Item Close jmiExit= new JMenuItem("Exit"); jmiExit.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"exit.png")); jmiExit.setMnemonic('E'); jmiExit.addActionListener(menuHandler); jmnFile.add(jmiExit); // Menu Item Reset jmiReset = new JMenuItem("Reset"); jmiReset.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"reset.png")); jmiReset.setMnemonic('R'); jmiReset.addActionListener(menuHandler); // Menu Item Edit jmnEdit.add(jmiReset); // Menu Item Help jmnHelp = new JMenu("Help"); jmnHelp.setMnemonic('H'); // Menu Item About jmiAbout = new JMenuItem("About"); jmiAbout.setIcon(new ImageIcon(ICONS_APPLICATION_PATH+"about.png")); jmiAbout.setMnemonic('A'); jmiAbout.addActionListener(menuHandler); menuBar.add(jmnHistory); jmnHelp.add(jmiAbout); menuBar.add(jmnHelp); /* TODO JAVADOC IS NOT FINISHED YET * jmnHelp.add(jmiJavadoc); */ add(menuBar, BorderLayout.NORTH); }