List of usage examples for javax.swing BorderFactory createLoweredBevelBorder
public static Border createLoweredBevelBorder()
From source file:com.isencia.passerelle.hmi.generic.GenericHMI.java
private JPanel createCompositePanel(final JPanel b, final JComponent c, final String name) { final JPanel compositeBox = new JPanel(new VerticalLayout(5)); int r = b.getBackground().getRed() - 20; if (r < 1) { r = 0;/*from w ww. j ava2 s . com*/ } if (r > 254) { r = 255; } int g = b.getBackground().getGreen() - 20; if (g < 1) { g = 0; } if (g > 254) { g = 255; } int bl = b.getBackground().getBlue() - 20; if (bl < 1) { bl = 0; } if (bl > 254) { bl = 255; } compositeBox.setBackground(new Color(r, g, bl)); final JPanel title = new JPanel(new BorderLayout()); title.setBackground(new Color(r, g, bl)); /* * ImageIcon icon = new ImageIcon( Toolkit .getDefaultToolkit() * .getImage( (getClass() * .getResource("/com/isencia/passerelle/hmi/resources/composite.gif" * )))); JLabel lab = new JLabel(icon); * * title.add(lab, BorderLayout.LINE_START); */ final JLabel lab2 = new JLabel(name); final Font f = lab2.getFont(); lab2.setFont(new Font(f.getName(), f.getStyle(), f.getSize() + 6)); lab2.setForeground(new Color(49, 106, 196)); title.add(lab2); compositeBox.add(title); final Border loweredbevel = BorderFactory.createLoweredBevelBorder(); final TitledBorder border = BorderFactory.createTitledBorder(loweredbevel); compositeBox.setBorder(border); compositeBox.setName(name); c.setBackground(new Color(r, g, bl)); compositeBox.add(c); return compositeBox; }
From source file:base.BasePlayer.Main.java
void setButtons() { try {// w w w . j a v a2 s . c o m // filemenu.setFont(font); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.NORTHWEST; c.insets = new Insets(1, 4, 4, 2); //c.insets = new Insets(5, 5, 2, 5); c.gridx = 0; c.gridy = 0; c.gridwidth = 1; /* opensamples.setMargin(new Insets(0, 0, 0,0)); opensamples.setPreferredSize(buttonDimension); addtracks.setMargin(new Insets(0, 0, 0, 0)); addtracks.setPreferredSize(buttonDimension); addcontrols.setMargin(new Insets(0, 0, 0, 0)); addcontrols.setPreferredSize(buttonDimension); */ menubar.setOpaque(true); panel.add(menubar, c); c.gridx = 1; setbut = new JButton("", settingsIcon); setbut.setToolTipText("Settings"); setbut.setOpaque(false); setbut.setContentAreaFilled(false); setbut.setBackground(Main.panel.getBackground()); setbut.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { Settings.frame.setLocation( frame.getLocationOnScreen().x + frame.getWidth() / 2 - Settings.frame.getWidth() / 2, frame.getLocationOnScreen().y + frame.getHeight() / 6); Settings.frame.setState(JFrame.NORMAL); Settings.frame.setVisible(true); } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { setbut.setOpaque(true); Main.setbut.setBackground(Color.white); Main.setbut.revalidate(); } @Override public void mouseExited(MouseEvent e) { setbut.setOpaque(false); Main.setbut.revalidate(); } }); setbut.setBorder(null); c.insets = new Insets(0, 2, 0, 0); menubar.add(setbut, c); // c.gridx = 1; // c.gridx = 2; // c.gridx = 3; // zoomout.setMargin(new Insets(0, 0, 0, 0)); // panel.add(zoomout, c); /* JMenuItem empty2 = new JMenuItem(""); empty2.setEnabled(false); menubar.add(empty2); c.gridx = 4;*/ // chromosomeDropdown.setPreferredSize(buttonDimension); // panel.add(chromosomeDropdown, c); // c.gridx = 5; // back.setMargin(new Insets(0, 0, 0, 0)); // forward.setMargin(new Insets(0, 0, 0, 0)); // back.setPreferredSize(new Dimension(back.getFontMetrics(back.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight())); // forward.setPreferredSize(new Dimension(forward.getFontMetrics(forward.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight())); //back.setMinimumSize(new Dimension(back.getFontMetrics(back.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight())); // forward.setMinimumSize(new Dimension(forward.getFontMetrics(forward.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight())); // panel.add(back, c); // c.gridx = 7; // panel.add(forward, c); chromosomeDropdown.setMaximumRowCount(25); chromosomeDropdown.setEnabled(true); chromosomeDropdown.addActionListener(ChromoDropActionListener); chromosomeDropdown.addMouseListener(this); c.gridwidth = 10; c.gridx = 0; c.gridy = 1; bedScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); bedScroll.getViewport().setPreferredSize(bedDimensions); drawScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); drawScroll.getViewport().setPreferredSize(drawDimensions); chromScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); chromScroll.getViewport().setPreferredSize(chromDimensions); drawScroll.getVerticalScrollBar().setAutoscrolls(false); // chromScroll.getViewport().setPreferredSize(new Dimension(drawWidth,chromHeight-20)); // drawScroll.setBorder(BorderFactory.createEmptyBorder()); //chromScroll.setBorder(BorderFactory.createLoweredBevelBorder()); // drawScroll.setBorder(BorderFactory.createLoweredBevelBorder()); // bedScroll.setBorder(BorderFactory.createLoweredBevelBorder()); // chromScroll.setBorder(BorderFactory.createEmptyBorder()); // bedScroll.setBorder(BorderFactory.createEmptyBorder()); controlScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); controlScroll.getViewport().setPreferredSize(bedDimensions); controlScroll.getViewport().add(controlDraw); controlDraw.setVisible(false); controlScroll.setVisible(false); chromScroll.setBorder(BorderFactory.createEmptyBorder()); drawScroll.setBorder(BorderFactory.createEmptyBorder()); bedScroll.setBorder(BorderFactory.createLoweredBevelBorder()); controlScroll.setBorder(BorderFactory.createLoweredBevelBorder()); addSplit(chromosomeDropdown.getItemAt(0)); chromScroll.getViewport().add(chromDraw); drawScroll.getViewport().add(drawCanvas); drawScroll.addMouseListener(this); bedCanvas = new BedCanvas(drawWidth, 200); bedScroll.getViewport().add(bedCanvas); frame.setExtendedState(frame.getExtendedState() | JFrame.MAXIMIZED_BOTH); c.weightx = 1.0; c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; trackPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, bedScroll, controlScroll); trackPane.setUI(new BasicSplitPaneUI() { public BasicSplitPaneDivider createDefaultDivider() { return new BasicSplitPaneDivider(this) { private static final long serialVersionUID = 1L; public void setBorder(Border b) { } @Override public void paint(Graphics g) { g.setColor(Color.lightGray); g.fillRect(0, 0, getSize().width, getSize().height); super.paint(g); } }; } }); trackPane.setBorder(null); trackPane.setDividerSize(0); trackPane.setPreferredSize(drawDimensions); trackPane.setResizeWeight(0.0); trackPane.setContinuousLayout(true); trackPane.setVisible(false); varpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, trackPane, drawScroll); varpane.setUI(new BasicSplitPaneUI() { public BasicSplitPaneDivider createDefaultDivider() { return new BasicSplitPaneDivider(this) { private static final long serialVersionUID = 1L; public void setBorder(Border b) { } @Override public void paint(Graphics g) { g.setColor(Color.lightGray); g.fillRect(0, 0, getSize().width, getSize().height); super.paint(g); } }; } }); varpane.setBorder(null); varpane.setDividerSize(0); varpane.setPreferredSize(drawDimensions); varpane.setResizeWeight(0.0); varpane.setContinuousLayout(true); bedScroll.setVisible(false); controlScroll.setVisible(false); chrompan = new JPanel() { private static final long serialVersionUID = 1L; protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Draw.sidecolor); g.fillRect(0, 0, this.getWidth(), this.getHeight()); g.setColor(Color.gray); g.fillRect(0, 0, 3, this.getHeight()); g.setColor(Color.lightGray); g.fillRect(2, 0, 2, this.getHeight()); } }; chrompan.setLayout(new GridBagLayout()); GridBagConstraints gb = new GridBagConstraints(); gb.anchor = GridBagConstraints.NORTHWEST; gb.insets = new Insets(2, 10, 2, 2); gb.gridx = 0; gb.gridy = 0; gb.gridwidth = 1; gb.fill = GridBagConstraints.HORIZONTAL; refDropdown.setBackground(Color.white); refDropdown.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray)); refDropdown.setBorder(BorderFactory.createCompoundBorder(refDropdown.getBorder(), BorderFactory.createEmptyBorder(0, 0, 0, 0))); geneDropdown.setBackground(Color.white); geneDropdown.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray)); geneDropdown.setBorder(BorderFactory.createCompoundBorder(geneDropdown.getBorder(), BorderFactory.createEmptyBorder(0, 0, 0, 0))); geneDropdown.addActionListener(annoDropActionListener); JLabel refLabel = new JLabel("Reference genome:"); JLabel geneLabel = new JLabel("Gene annotation:"); chromLabel.setName("header"); chrompan.add(chromLabel, gb); gb.gridy++; chrompan.add(new JSeparator(), gb); gb.gridy++; gb.insets = new Insets(0, 10, 0, 2); chrompan.add(refLabel, gb); gb.gridy++; chrompan.add(refDropdown, gb); gb.gridy++; chrompan.add(geneLabel, gb); gb.gridy++; chrompan.add(geneDropdown, gb); gb.gridy++; gb.insets = new Insets(20, 10, 0, 2); JLabel memory = new JLabel("Memory usage:"); memory.setName("header"); chrompan.add(memory, gb); gb.insets = new Insets(0, 10, 0, 2); gb.gridy++; chrompan.add(memLabel, gb); gb.weightx = 1; gb.weighty = 1; gb.gridwidth = GridBagConstraints.REMAINDER; chrompan.add(new JLabel(), gb); chrompan.setMinimumSize(new Dimension(1, 1)); chrompan.addComponentListener(this); upPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, chrompan, chromScroll); drawScroll.addComponentListener(this); //upPanel.setBorder(BorderFactory.createLoweredBevelBorder()); upPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.white)); upPanel.setDividerLocation(Main.sidebarWidth - 2); chrompan.setBackground(Draw.sidecolor); BasicSplitPaneUI chromPaneUI = (BasicSplitPaneUI) upPanel.getUI(); chromPaneDivider = chromPaneUI.getDivider(); chromPaneDivider.addMouseListener(this); upPanel.setDividerSize(3); upPanel.setUI(new BasicSplitPaneUI() { public BasicSplitPaneDivider createDefaultDivider() { return new BasicSplitPaneDivider(this) { private static final long serialVersionUID = 1L; public void setBorder(Border b) { } @Override public void paint(Graphics g) { g.setColor(Color.lightGray); g.fillRect(0, 0, getSize().width, getSize().height); super.paint(g); } }; } }); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upPanel, varpane); splitPane.setUI(new BasicSplitPaneUI() { public BasicSplitPaneDivider createDefaultDivider() { return new BasicSplitPaneDivider(this) { private static final long serialVersionUID = 1L; public void setBorder(Border b) { } @Override public void paint(Graphics g) { g.setColor(Color.lightGray); g.fillRect(0, 0, getSize().width, getSize().height); super.paint(g); } }; } }); BasicSplitPaneUI basicSplitPaneUI = (BasicSplitPaneUI) splitPane.getUI(); splitPaneDivider = basicSplitPaneUI.getDivider(); // splitPaneDivider.addMouseListener(this); basicSplitPaneUI = (BasicSplitPaneUI) trackPane.getUI(); trackPaneDivider = basicSplitPaneUI.getDivider(); // trackPaneDivider.addMouseListener(this); BasicSplitPaneUI splitPaneUI = (BasicSplitPaneUI) varpane.getUI(); varPaneDivider = splitPaneUI.getDivider(); // varPaneDivider.addMouseListener(this); splitPane.setDividerSize(3); splitPane.setPreferredSize(drawDimensions); splitPane.setContinuousLayout(true); panel.add(splitPane, c); add(panel, c); openvcfs.addActionListener(this); openbams.addActionListener(this); addtracks.addActionListener(this); addcontrols.addActionListener(this); openProject.addActionListener(this); saveProject.addActionListener(this); saveProjectAs.addActionListener(this); dosomething.addActionListener(this); clear.addActionListener(this); // drawScroll.getVerticalScrollBar().addMouseMotionListener(this); drawScroll.getVerticalScrollBar().addMouseListener(this); drawScroll.getVerticalScrollBar().addMouseMotionListener(this); drawScroll.getVerticalScrollBar().addMouseWheelListener(new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { Draw.setGlasspane(true); if (e.getWheelRotation() < 0) { if (drawCanvas.drawVariables.visiblestart > 0) { drawCanvas.drawVariables.visiblestart--; } Draw.setScrollbar((int) (drawCanvas.drawVariables.visiblestart * drawCanvas.drawVariables.sampleHeight)); } else { if (drawCanvas.drawVariables.visiblestart + drawCanvas.drawVariables.visiblesamples < Main.samples) { drawCanvas.drawVariables.visiblestart++; } Draw.setScrollbar((int) (drawCanvas.drawVariables.visiblestart * drawCanvas.drawVariables.sampleHeight)); } } } ); drawScroll.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent event) { //System.out.println(drawCanvas.drawVariables.visiblestart +" " +(short)(Main.drawScroll.getVerticalScrollBar().getValue()/drawCanvas.drawVariables.sampleHeight)); if (drawCanvas.drawVariables.visiblestart != (short) (Main.drawScroll.getVerticalScrollBar() .getValue() / drawCanvas.drawVariables.sampleHeight)) { if (!drawCanvas.sidebar) { drawCanvas.drawVariables.visiblestart = (short) (Main.drawScroll.getVerticalScrollBar() .getValue() / drawCanvas.drawVariables.sampleHeight); } if (drawCanvas.splits.size() > 1) { for (int i = 0; i < drawCanvas.splits.size(); i++) { drawCanvas.splits.get(i).updateReads = true; } } else { Draw.updateReads = true; Draw.updatevars = true; } Draw.updatevars = true; Main.drawCanvas.repaint(); } } }); zoomout.addActionListener(this); FileRead.head = new VarNode(0, (byte) 0, "N", (short) 0, (short) 0, false, (float) 0, (float) 0, null, null, new Sample("", (short) 1, null), null, null); drawCanvas.current = FileRead.head; frame.addComponentListener(this); frame.addMouseListener(this); frame.setGlassPane(glassPane); glassPane.setOpaque(false); glassPane.setVisible(false); positionField.setText("chr1:1-" + MethodLibrary.formatNumber(drawCanvas.splits.get(0).chromEnd)); positionField.setToolTipText("Current chromosomal region"); widthLabel.setText(MethodLibrary.formatNumber(drawCanvas.splits.get(0).chromEnd) + "bp"); widthLabel.setToolTipText("Current region width in base pairs"); } catch (Exception e) { e.printStackTrace(); } }
From source file:ome.formats.importer.gui.StatusBar.java
/** * Build and lay out the UI/*from www .j a v a 2s . co m*/ */ private void buildUI() { Border compoundBorder = BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(0, 4, 0, 15)); setPreferredSize(new Dimension(10, 28)); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setBorder( BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, -2, -2, -2), compoundBorder)); add(status); add(buildComponentPanelRight(progressBar)); }
From source file:org.openmicroscopy.shoola.agents.util.ui.ChannelButton.java
/** * Overridden to set the border of the button. * @see ColouredButton#setSelected(boolean) *//*from w w w.j a va 2 s .co m*/ public void setSelected(boolean selected) { super.setSelected(selected); if (selected) setBorder(BorderFactory.createLoweredBevelBorder()); else setBorder(BorderFactory.createRaisedBevelBorder()); }
From source file:utybo.branchingstorytree.swing.OpenBSTGUI.java
private JMenu createShortMenu() { JMenu shortMenu = new JMenu(); addDarkModeCallback(b -> {/* w w w.jav a 2 s . com*/ shortMenu.setBackground(b ? OPENBST_BLUE.darker().darker() : OPENBST_BLUE.brighter()); shortMenu.setForeground(b ? Color.WHITE : OPENBST_BLUE); }); shortMenu.setBackground(OPENBST_BLUE.brighter()); shortMenu.setForeground(OPENBST_BLUE); shortMenu.setText(Lang.get("banner.title")); shortMenu.setIcon(new ImageIcon(Icons.getImage("Logo", 16))); JMenuItem label = new JMenuItem(Lang.get("menu.title")); label.setEnabled(false); shortMenu.add(label); shortMenu.addSeparator(); shortMenu.add( new JMenuItem(new AbstractAction(Lang.get("menu.open"), new ImageIcon(Icons.getImage("Open", 16))) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { openStory(VisualsUtils.askForFile(OpenBSTGUI.this, Lang.get("file.title"))); } })); shortMenu.addSeparator(); shortMenu.add(new JMenuItem( new AbstractAction(Lang.get("menu.create"), new ImageIcon(Icons.getImage("Add Property", 16))) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { doNewEditor(); } })); JMenu additionalMenu = new JMenu(Lang.get("menu.advanced")); shortMenu.add(additionalMenu); additionalMenu.add(new JMenuItem( new AbstractAction(Lang.get("menu.package"), new ImageIcon(Icons.getImage("Open Archive", 16))) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { new PackageDialog(instance).setVisible(true); } })); additionalMenu.add(new JMenuItem( new AbstractAction(Lang.get("langcheck"), new ImageIcon(Icons.getImage("LangCheck", 16))) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { final Map<String, String> languages = new Gson() .fromJson(new InputStreamReader( OpenBST.class.getResourceAsStream( "/utybo/branchingstorytree/swing/lang/langs.json"), StandardCharsets.UTF_8), new TypeToken<Map<String, String>>() { }.getType()); languages.remove("en"); languages.remove("default"); JComboBox<String> jcb = new JComboBox<>(new Vector<>(languages.keySet())); JPanel panel = new JPanel(); panel.add(new JLabel(Lang.get("langcheck.choose"))); panel.add(jcb); int result = JOptionPane.showOptionDialog(OpenBSTGUI.this, panel, Lang.get("langcheck"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if (result == JOptionPane.OK_OPTION) { Locale selected = new Locale((String) jcb.getSelectedItem()); if (!Lang.getMap().keySet().contains(selected)) { try { Lang.loadTranslationsFromFile(selected, OpenBST.class .getResourceAsStream("/utybo/branchingstorytree/swing/lang/" + languages.get(jcb.getSelectedItem().toString()))); } catch (UnrespectedModelException | IOException e1) { LOG.warn("Failed to load translation file", e1); } } ArrayList<String> list = new ArrayList<>(); Lang.getLocaleMap(Locale.ENGLISH).forEach((k, v) -> { if (!Lang.getLocaleMap(selected).containsKey(k)) { list.add(k + "\n"); } }); StringBuilder sb = new StringBuilder(); Collections.sort(list); list.forEach(s -> sb.append(s)); JDialog dialog = new JDialog(OpenBSTGUI.this, Lang.get("langcheck")); dialog.getContentPane().setLayout(new MigLayout()); dialog.getContentPane().add(new JLabel(Lang.get("langcheck.result")), "pushx, growx, wrap"); JTextArea area = new JTextArea(); area.setLineWrap(true); area.setWrapStyleWord(true); area.setText(sb.toString()); area.setEditable(false); area.setBorder(BorderFactory.createLoweredBevelBorder()); JScrollPane jsp = new JScrollPane(area); jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); dialog.getContentPane().add(jsp, "pushx, pushy, growx, growy"); dialog.setSize((int) (Icons.getScale() * 300), (int) (Icons.getScale() * 300)); dialog.setLocationRelativeTo(OpenBSTGUI.this); dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); } } })); additionalMenu.add(new JMenuItem( new AbstractAction(Lang.get("menu.debug"), new ImageIcon(Icons.getImage("Code", 16))) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { DebugInfo.launch(OpenBSTGUI.this); } })); JMenu includedFiles = new JMenu("Included BST files"); for (Entry<String, String> entry : OpenBST.getInternalFiles().entrySet()) { JMenuItem jmi = new JMenuItem(entry.getKey()); jmi.addActionListener(ev -> { String path = "/bst/" + entry.getValue(); InputStream is = OpenBSTGUI.class.getResourceAsStream(path); ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(OpenBSTGUI.this, "Extracting...", is); new Thread(() -> { try { File f = File.createTempFile("openbstinternal", ".bsp"); FileOutputStream fos = new FileOutputStream(f); IOUtils.copy(pmis, fos); openStory(f); } catch (final IOException e) { LOG.error("IOException caught", e); showException(Lang.get("file.error").replace("$e", e.getClass().getSimpleName()) .replace("$m", e.getMessage()), e); } }).start(); }); includedFiles.add(jmi); } additionalMenu.add(includedFiles); shortMenu.addSeparator(); JMenu themesMenu = new JMenu(Lang.get("menu.themes")); shortMenu.add(themesMenu); themesMenu.setIcon(new ImageIcon(Icons.getImage("Color Wheel", 16))); ButtonGroup themesGroup = new ButtonGroup(); JRadioButtonMenuItem jrbmi; jrbmi = new JRadioButtonMenuItem(Lang.get("menu.themes.dark")); if (0 == selectedTheme) { jrbmi.setSelected(true); } jrbmi.addActionListener(e -> switchLaF(0, DARK_THEME)); themesMenu.add(jrbmi); themesGroup.add(jrbmi); jrbmi = new JRadioButtonMenuItem(Lang.get("menu.themes.light")); if (1 == selectedTheme) { jrbmi.setSelected(true); } jrbmi.addActionListener(e -> switchLaF(1, LIGHT_THEME)); themesMenu.add(jrbmi); themesGroup.add(jrbmi); jrbmi = new JRadioButtonMenuItem(Lang.get("menu.themes.debug")); if (2 == selectedTheme) { jrbmi.setSelected(true); } jrbmi.addActionListener(e -> switchLaF(2, DEBUG_THEME)); themesMenu.add(jrbmi); themesGroup.add(jrbmi); JMenu additionalLightThemesMenu = new JMenu(Lang.get("menu.themes.morelight")); int j = 3; for (Map.Entry<String, LookAndFeel> entry : ADDITIONAL_LIGHT_THEMES.entrySet()) { int jf = j; jrbmi = new JRadioButtonMenuItem(entry.getKey()); if (j == selectedTheme) jrbmi.setSelected(true); jrbmi.addActionListener(e -> switchLaF(jf, entry.getValue())); additionalLightThemesMenu.add(jrbmi); themesGroup.add(jrbmi); j++; } themesMenu.add(additionalLightThemesMenu); JMenu additionalDarkThemesMenu = new JMenu(Lang.get("menu.themes.moredark")); for (Map.Entry<String, LookAndFeel> entry : ADDITIONAL_DARK_THEMES.entrySet()) { int jf = j; jrbmi = new JRadioButtonMenuItem(entry.getKey()); if (j == selectedTheme) jrbmi.setSelected(true); jrbmi.addActionListener(e -> switchLaF(jf, entry.getValue())); additionalDarkThemesMenu.add(jrbmi); themesGroup.add(jrbmi); j++; } themesMenu.add(additionalDarkThemesMenu); shortMenu.add(new JMenuItem( new AbstractAction(Lang.get("menu.about"), new ImageIcon(Icons.getImage("About", 16))) { /** * */ private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { new AboutDialog(instance).setVisible(true); } })); return shortMenu; }