List of usage examples for javax.swing JMenuItem setMnemonic
@BeanProperty(visualUpdate = true, description = "the keyboard character mnemonic") public void setMnemonic(int mnemonic)
From source file:org.tinymediamanager.ui.MainWindow.java
/** * Create the application./*w w w .j a va 2 s. c o m*/ * * @param name * the name */ public MainWindow(String name) { super(name); setName("mainWindow"); setMinimumSize(new Dimension(1000, 700)); instance = this; JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenu mnTmm = new JMenu("tinyMediaManager"); mnTmm.setMnemonic(KeyEvent.VK_T); menuBar.add(mnTmm); if (!Globals.isDonator()) { mnTmm.add(new RegisterDonatorVersionAction()); } mnTmm.add(new SettingsAction()); mnTmm.addSeparator(); mnTmm.add(new LaunchUpdaterAction()); mnTmm.addSeparator(); mnTmm.add(new ExitAction()); initialize(); // tools menu JMenu tools = new JMenu(BUNDLE.getString("tmm.tools")); //$NON-NLS-1$ tools.setMnemonic(KeyEvent.VK_O); tools.add(new ClearDatabaseAction()); JMenu cache = new JMenu(BUNDLE.getString("tmm.cache")); //$NON-NLS-1$ cache.setMnemonic(KeyEvent.VK_C); tools.add(cache); JMenuItem clearImageCache = new JMenuItem(new ClearImageCacheAction()); clearImageCache.setMnemonic(KeyEvent.VK_I); cache.add(clearImageCache); JMenuItem rebuildImageCache = new JMenuItem(new RebuildImageCacheAction()); rebuildImageCache.setMnemonic(KeyEvent.VK_R); cache.add(rebuildImageCache); JMenuItem tmmFolder = new JMenuItem(BUNDLE.getString("tmm.gotoinstalldir")); //$NON-NLS-1$ tmmFolder.setMnemonic(KeyEvent.VK_I); tools.add(tmmFolder); tmmFolder.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Path path = Paths.get(System.getProperty("user.dir")); try { // check whether this location exists if (Files.exists(path)) { TmmUIHelper.openFile(path); } } catch (Exception ex) { LOGGER.error("open filemanager", ex); MessageManager.instance.pushMessage(new Message(MessageLevel.ERROR, path, "message.erroropenfolder", new String[] { ":", ex.getLocalizedMessage() })); } } }); JMenuItem tmmLogs = new JMenuItem(BUNDLE.getString("tmm.errorlogs")); //$NON-NLS-1$ tmmLogs.setMnemonic(KeyEvent.VK_L); tools.add(tmmLogs); tmmLogs.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { JDialog logDialog = new LogDialog(); logDialog.setLocationRelativeTo(MainWindow.getActiveInstance()); logDialog.setVisible(true); } }); JMenuItem tmmMessages = new JMenuItem(BUNDLE.getString("tmm.messages")); //$NON-NLS-1$ tmmMessages.setMnemonic(KeyEvent.VK_L); tools.add(tmmMessages); tmmMessages.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { JDialog messageDialog = MessageHistoryDialog.getInstance(); messageDialog.setVisible(true); } }); tools.addSeparator(); final JMenu menuWakeOnLan = new JMenu(BUNDLE.getString("tmm.wakeonlan")); //$NON-NLS-1$ menuWakeOnLan.setMnemonic(KeyEvent.VK_W); menuWakeOnLan.addMenuListener(new MenuListener() { @Override public void menuCanceled(MenuEvent arg0) { } @Override public void menuDeselected(MenuEvent arg0) { } @Override public void menuSelected(MenuEvent arg0) { menuWakeOnLan.removeAll(); for (final WolDevice device : Globals.settings.getWolDevices()) { JMenuItem item = new JMenuItem(device.getName()); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Utils.sendWakeOnLanPacket(device.getMacAddress()); } }); menuWakeOnLan.add(item); } } }); tools.add(menuWakeOnLan); // activate/deactivate WakeOnLan menu item tools.addMenuListener(new MenuListener() { @Override public void menuSelected(MenuEvent e) { if (Globals.settings.getWolDevices().size() > 0) { menuWakeOnLan.setEnabled(true); } else { menuWakeOnLan.setEnabled(false); } } @Override public void menuDeselected(MenuEvent e) { } @Override public void menuCanceled(MenuEvent e) { } }); if (Globals.isDebug()) { final JMenu debugMenu = new JMenu("Debug"); //$NON-NLS-1$ JMenuItem trace = new JMenuItem("set Logger to TRACE"); //$NON-NLS-1$ trace.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); lc.getLogger("org.tinymediamanager").setLevel(Level.TRACE); MessageManager.instance.pushMessage(new Message("Trace levels set!", "")); LOGGER.trace("if you see that, we're now on TRACE logging level ;)"); } }); debugMenu.add(trace); tools.add(debugMenu); } menuBar.add(tools); mnTmm = new JMenu(BUNDLE.getString("tmm.contact")); //$NON-NLS-1$ mnTmm.setMnemonic(KeyEvent.VK_C); mnTmm.add(new FeedbackAction()).setMnemonic(KeyEvent.VK_F); mnTmm.add(new BugReportAction()).setMnemonic(KeyEvent.VK_B); menuBar.add(mnTmm); mnTmm = new JMenu(BUNDLE.getString("tmm.help")); //$NON-NLS-1$ mnTmm.setMnemonic(KeyEvent.VK_H); menuBar.add(mnTmm); mnTmm.add(new WikiAction()).setMnemonic(KeyEvent.VK_W); mnTmm.add(new FaqAction()).setMnemonic(KeyEvent.VK_F); mnTmm.add(new ForumAction()).setMnemonic(KeyEvent.VK_O); mnTmm.addSeparator(); mnTmm.add(new AboutAction()).setMnemonic(KeyEvent.VK_A); menuBar.add(Box.createGlue()); if (!Globals.isDonator()) { JButton btnDonate = new JButton(new DonateAction()); btnDonate.setBorderPainted(false); btnDonate.setFocusPainted(false); btnDonate.setContentAreaFilled(false); menuBar.add(btnDonate); } checkForUpdate(); }
From source file:org.tinymediamanager.ui.movies.MoviePanel.java
private void buildMenu() { menu.setMnemonic(KeyEvent.VK_M); // menu items JMenuItem menuItem = menu.add(actionUpdateDataSources2); menuItem.setMnemonic(KeyEvent.VK_U); menuItem.setAccelerator(//from ww w .j a va 2 s. c o m KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); final JMenu menuUpdateDatasources = new JMenu(BUNDLE.getString("update.datasource")); //$NON-NLS-1$ final JMenu menuFindMissingMovies = new JMenu(BUNDLE.getString("movie.findmissing")); //$NON-NLS-1$ menuUpdateDatasources.addMenuListener(new MenuListener() { @Override public void menuCanceled(MenuEvent arg0) { } @Override public void menuDeselected(MenuEvent arg0) { } @Override public void menuSelected(MenuEvent arg0) { menuUpdateDatasources.removeAll(); menuFindMissingMovies.removeAll(); for (String ds : MovieModuleManager.MOVIE_SETTINGS.getMovieDataSource()) { JMenuItem item = new JMenuItem(new MovieUpdateSingleDatasourceAction(ds)); menuUpdateDatasources.add(item); item = new JMenuItem(new MovieFindMissingAction(ds)); menuFindMissingMovies.add(item); } } }); menu.add(menuUpdateDatasources); menu.add(new MovieFindMissingAction()); menu.add(menuFindMissingMovies); menu.add(new MovieCreateOfflineAction(true)); menu.addSeparator(); JMenu menuScrape = new JMenu(BUNDLE.getString("Button.scrape")); //$NON-NLS-1$ menuScrape.setMnemonic(KeyEvent.VK_S); menuItem = menuScrape.add(actionScrape2); menuItem.setMnemonic(KeyEvent.VK_S); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuScrape.add(actionScrapeSelected); menuItem.setMnemonic(KeyEvent.VK_F); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuScrape.add(actionScrapeUnscraped); menuItem.setMnemonic(KeyEvent.VK_U); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuScrape.add(actionScrapeMetadataSelected); menuItem.setMnemonic(KeyEvent.VK_M); menuScrape.add(actionAssignMovieSets); menu.add(menuScrape); JMenu menuEdit = new JMenu(BUNDLE.getString("Button.edit")); //$NON-NLS-1$ menuEdit.setMnemonic(KeyEvent.VK_E); menuItem = menuEdit.add(actionEditMovie2); menuItem.setMnemonic(KeyEvent.VK_E); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionBatchEdit); menuItem.setMnemonic(KeyEvent.VK_B); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionSetWatchedFlag); menuItem.setMnemonic(KeyEvent.VK_W); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionRename2); menuItem.setMnemonic(KeyEvent.VK_R); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionRenamerPreview); menuItem.setMnemonic(KeyEvent.VK_P); menu.add(menuEdit); menuItem = menu.add(actionRewriteNfo); menuItem.setMnemonic(KeyEvent.VK_N); menuItem = menu.add(actionTrailerDownload); menuItem = menu.add(actionSearchSubtitle); menuItem = menu.add(actionDownloadSubtitle); menu.addSeparator(); menuItem = menu.add(actionMediaInformation2); menuItem.setMnemonic(KeyEvent.VK_M); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menu.add(actionExport); menuItem.setMnemonic(KeyEvent.VK_X); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menu.add(actionRemove2); menuItem.setMnemonic(KeyEvent.VK_R); menuItem.setAccelerator(KeyStroke.getKeyStroke((char) KeyEvent.VK_DELETE)); menuItem = menu.add(actionDelete2); menuItem.setMnemonic(KeyEvent.VK_R); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, ActionEvent.SHIFT_MASK)); menu.addSeparator(); menuItem = menu.add(actionSyncTrakt); menuItem.setMnemonic(KeyEvent.VK_T); menuItem = menu.add(actionSyncWatchedTrakt); menuItem.setMnemonic(KeyEvent.VK_W); menuItem = menu.add(actionSyncSelectedTrakt); menu.addSeparator(); menuItem = menu.add(actionClearImageCache); menuItem.setMnemonic(KeyEvent.VK_C); // popup menu JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(actionScrape2); popupMenu.add(actionScrapeSelected); popupMenu.add(actionScrapeUnscraped); popupMenu.add(actionScrapeMetadataSelected); popupMenu.add(actionAssignMovieSets); popupMenu.addSeparator(); popupMenu.add(actionEditMovie2); popupMenu.add(actionBatchEdit); popupMenu.add(actionSetWatchedFlag); popupMenu.add(actionRewriteNfo); popupMenu.add(actionRename2); popupMenu.add(actionRenamerPreview); popupMenu.add(actionMediaInformation2); popupMenu.add(actionExport); popupMenu.add(actionTrailerDownload); popupMenu.add(actionSearchSubtitle); popupMenu.add(actionDownloadSubtitle); popupMenu.addSeparator(); popupMenu.add(actionSyncTrakt); popupMenu.add(actionSyncWatchedTrakt); popupMenu.add(actionSyncSelectedTrakt); popupMenu.addSeparator(); popupMenu.add(actionClearImageCache); popupMenu.addSeparator(); popupMenu.add(actionRemove2); popupMenu.add(actionDelete2); if (Globals.isDebug()) { JMenu menuDebug = new JMenu("Debug"); //$NON-NLS-1$ menuDebug.add(debugDumpMovie); menuDebug.addSeparator(); menuDebug.add(new FakeTmmTaskAction("download", 1, 10)); menuDebug.add(new FakeTmmTaskAction("download", 10, 10)); menuDebug.add(new FakeTmmTaskAction("image", 1, 10)); menuDebug.add(new FakeTmmTaskAction("image", 10, 10)); menuDebug.add(new FakeTmmTaskAction("unnamed", 1, 10)); menuDebug.add(new FakeTmmTaskAction("unnamed", 10, 10)); popupMenu.add(menuDebug); } MouseListener mouseListener = new MovieTableMouseListener(popupMenu, table); table.addMouseListener(mouseListener); }
From source file:org.tinymediamanager.ui.tvshows.TvShowPanel.java
/** * Builds the menu.// w w w . j av a 2 s .c om */ private void buildMenu() { menu.setMnemonic(KeyEvent.VK_V); // menu items JMenuItem menuItem = menu.add(actionUpdateDatasources2); menuItem.setMnemonic(KeyEvent.VK_U); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menu.addSeparator(); JMenu menuScrape = new JMenu(BUNDLE.getString("Button.scrape")); //$NON-NLS-1$ menuScrape.setMnemonic(KeyEvent.VK_S); menuItem = menuScrape.add(actionScrape2); menuItem.setMnemonic(KeyEvent.VK_S); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuScrape.add(actionScrapeSelected); menuItem.setMnemonic(KeyEvent.VK_F); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuScrape.add(actionScrapeNewItems); menuItem.setMnemonic(KeyEvent.VK_N); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menu.add(menuScrape); JMenu menuEdit = new JMenu(BUNDLE.getString("Button.edit")); //$NON-NLS-1$ menuEdit.setMnemonic(KeyEvent.VK_E); menuItem = menuEdit.add(actionEdit2); menuItem.setMnemonic(KeyEvent.VK_E); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionBatchEdit); menuItem.setMnemonic(KeyEvent.VK_B); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionSetWatchedFlag); menuItem.setMnemonic(KeyEvent.VK_W); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menuEdit.add(actionChangeSeasonPoster2); menuItem.setMnemonic(KeyEvent.VK_S); menuEdit.add(actionChangeToDvdOrder); menuEdit.add(actionChangeToAiredOrder); menu.add(menuEdit); menu.add(actionRewriteTvShowNfo); menu.add(actionRewriteTvShowEpisodeNfo); menuItem = menu.add(actionRename); menuItem.setMnemonic(KeyEvent.VK_R); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menu.add(actionMediaInformation2); menuItem.setMnemonic(KeyEvent.VK_M); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_M, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menu.add(actionExport); menuItem.setMnemonic(KeyEvent.VK_X); menuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK + ActionEvent.SHIFT_MASK)); menuItem = menu.add(actionClearImageCache); menuItem.setMnemonic(KeyEvent.VK_C); menu.addSeparator(); menuItem = menu.add(actionRemove2); menuItem.setAccelerator(KeyStroke.getKeyStroke((char) KeyEvent.VK_DELETE)); menuItem = menu.add(actionDelete2); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, ActionEvent.SHIFT_MASK)); menu.addSeparator(); menuItem = menu.add(actionSyncTrakt); menuItem.setMnemonic(KeyEvent.VK_T); menuItem = menu.add(actionSyncWatchedTrakt); menuItem.setMnemonic(KeyEvent.VK_W); menuItem = menu.add(actionSyncSelectedTrakt); // popup menu JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(actionScrape2); popupMenu.add(actionScrapeSelected); popupMenu.add(actionScrapeEpisodes); popupMenu.add(actionScrapeEpisodes2); popupMenu.add(actionScrapeNewItems); // popupMenu.add(actionScrapeMetadataSelected); popupMenu.addSeparator(); popupMenu.add(actionUpdateTvShow); popupMenu.addSeparator(); popupMenu.add(actionEdit2); popupMenu.add(actionChangeSeasonPoster2); popupMenu.add(actionBatchEdit); popupMenu.add(actionSetWatchedFlag); popupMenu.add(actionChangeToDvdOrder); popupMenu.add(actionChangeToAiredOrder); popupMenu.add(actionRewriteTvShowNfo); popupMenu.add(actionRewriteTvShowEpisodeNfo); // popupMenu.add(actionBatchEdit); popupMenu.add(actionRename); popupMenu.add(actionMediaInformation2); popupMenu.add(actionExport); popupMenu.add(actionClearImageCache); popupMenu.addSeparator(); popupMenu.add(actionDownloadSubtitles); popupMenu.add(actionSearchAndDownloadSubtitles); popupMenu.addSeparator(); popupMenu.add(actionSyncTrakt); popupMenu.add(actionSyncWatchedTrakt); popupMenu.add(actionSyncSelectedTrakt); popupMenu.addSeparator(); popupMenu.add(actionRemove2); popupMenu.add(actionDelete2); popupMenu.addSeparator(); popupMenu.add(new ExpandAllAction()); popupMenu.add(new CollapseAllAction()); if (Globals.isDebug()) { JMenu menuDebug = new JMenu("Debug"); //$NON-NLS-1$ menuDebug.add(debugDumpShow); popupMenu.addSeparator(); popupMenu.add(menuDebug); } MouseListener popupListener = new TreePopupListener(popupMenu, tree); tree.addMouseListener(popupListener); }
From source file:pl.otros.logview.gui.LogViewMainFrame.java
private void initMenu() { JMenuBar menuBar = getJMenuBar(); if (menuBar == null) { menuBar = new JMenuBar(); setJMenuBar(menuBar);//www. ja v a 2s .c o m } menuBar.removeAll(); JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); JLabel labelOpenLog = new JLabel("Open log", Icons.FOLDER_OPEN, SwingConstants.LEFT); Font menuGroupFont = labelOpenLog.getFont().deriveFont(13f).deriveFont(Font.BOLD); labelOpenLog.setFont(menuGroupFont); fileMenu.add(labelOpenLog); JMenuItem openAutoDetectLog = new JMenuItem("Open log with autodetect type"); openAutoDetectLog.addActionListener(new ImportLogWithAutoDetectedImporterActionListener(otrosApplication)); openAutoDetectLog.setMnemonic(KeyEvent.VK_O); openAutoDetectLog.setIcon(Icons.WIZARD); fileMenu.add(openAutoDetectLog); JMenuItem tailAutoDetectLog = new JMenuItem("Tail log with autodetect type"); tailAutoDetectLog.addActionListener(new TailLogWithAutoDetectActionListener(otrosApplication)); tailAutoDetectLog.setMnemonic(KeyEvent.VK_T); tailAutoDetectLog.setIcon(Icons.ARROW_REPEAT); fileMenu.add(tailAutoDetectLog); fileMenu.add(new TailMultipleFilesIntoOneView(otrosApplication)); fileMenu.add(new ConnectToSocketHubAppenderAction(otrosApplication)); fileMenu.add(new JSeparator()); JLabel labelLogInvestigation = new JLabel("Log investigation", SwingConstants.LEFT); labelLogInvestigation.setFont(menuGroupFont); fileMenu.add(labelLogInvestigation); fileMenu.add(new OpenLogInvestigationAction(otrosApplication)); JMenuItem saveLogsInvest = new JMenuItem(new SaveLogInvestigationAction(otrosApplication)); enableDisableComponetsForTabs.addComponet(saveLogsInvest); fileMenu.add(saveLogsInvest); fileMenu.add(new JSeparator()); LogImporter[] importers = new LogImporter[0]; importers = logImportersContainer.getElements().toArray(importers); for (LogImporter logImporter : importers) { JMenuItem openLog = new JMenuItem("Open " + logImporter.getName() + " log"); openLog.addActionListener(new ImportLogWithGivenImporterActionListener(otrosApplication, logImporter)); if (logImporter.getKeyStrokeAccelelator() != null) { openLog.setAccelerator(KeyStroke.getKeyStroke(logImporter.getKeyStrokeAccelelator())); } if (logImporter.getMnemonic() > 0) { openLog.setMnemonic(logImporter.getMnemonic()); } Icon icon = logImporter.getIcon(); if (icon != null) { openLog.setIcon(icon); } fileMenu.add(openLog); } fileMenu.add(new JSeparator()); JLabel labelTailLog = new JLabel("Tail log [from begging of file]", Icons.ARROW_REPEAT, SwingConstants.LEFT); labelTailLog.setFont(menuGroupFont); fileMenu.add(labelTailLog); for (LogImporter logImporter : importers) { JMenuItem openLog = new JMenuItem("Tail " + logImporter.getName() + " log"); openLog.addActionListener(new TailLogActionListener(otrosApplication, logImporter)); if (logImporter.getKeyStrokeAccelelator() != null) { openLog.setAccelerator(KeyStroke.getKeyStroke(logImporter.getKeyStrokeAccelelator())); } if (logImporter.getMnemonic() > 0) { openLog.setMnemonic(logImporter.getMnemonic()); } Icon icon = logImporter.getIcon(); if (icon != null) { openLog.setIcon(icon); } fileMenu.add(openLog); } JMenuItem exitMenuItem = new JMenuItem("Exit", 'e'); exitMenuItem.setIcon(Icons.TURN_OFF); exitMenuItem.setAccelerator(KeyStroke.getKeyStroke("control F4")); exitAction = new ExitAction(this); exitMenuItem.addActionListener(exitAction); fileMenu.add(new JSeparator()); fileMenu.add(exitMenuItem); JMenu toolsMenu = new JMenu("Tools"); toolsMenu.setMnemonic(KeyEvent.VK_T); JMenuItem closeAll = new JMenuItem(new CloseAllTabsAction(otrosApplication)); enableDisableComponetsForTabs.addComponet(closeAll); ArrayList<SocketLogReader> logReaders = new ArrayList<SocketLogReader>(); toolsMenu.add(new JMenuItem(new StartSocketListener(otrosApplication, logReaders))); toolsMenu.add(new JMenuItem(new StopAllSocketListeners(otrosApplication, logReaders))); toolsMenu.add(new ShowMarkersEditor(otrosApplication)); toolsMenu.add(new ShowLog4jPatternParserEditor(otrosApplication)); toolsMenu.add(new ShowMessageColorizerEditor(otrosApplication)); toolsMenu.add(new ShowLoadedPlugins(otrosApplication)); toolsMenu.add(new ShowOlvLogs(otrosApplication)); toolsMenu.add(new OpenPreferencesAction(otrosApplication)); toolsMenu.add(closeAll); JMenu pluginsMenu = new JMenu("Plugins"); otrosApplication.setPluginsMenu(pluginsMenu); JMenu helpMenu = new JMenu("Help"); JMenuItem about = new JMenuItem("About"); AboutAction action = new AboutAction(otrosApplication); action.putValue(Action.NAME, "About"); about.setAction(action); helpMenu.add(about); helpMenu.add(new GoToDonatePageAction(otrosApplication)); JMenuItem checkForNewVersion = new JMenuItem(new CheckForNewVersionAction(otrosApplication)); helpMenu.add(checkForNewVersion); helpMenu.add(new GettingStartedAction(otrosApplication)); menuBar.add(fileMenu); menuBar.add(toolsMenu); menuBar.add(pluginsMenu); menuBar.add(helpMenu); }