Browse Source

Added rounded button variant.

Added HelpButton and HelpMenuItem.
pull/170/head
weisj 5 years ago
parent
commit
e5d993b6e2
  1. 49
      core/src/main/java/com/github/weisj/darklaf/components/help/HelpButton.java
  2. 42
      core/src/main/java/com/github/weisj/darklaf/components/help/HelpMenuItem.java
  3. 19
      core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java
  4. 14
      core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java
  5. 3
      core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java
  6. 14
      core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
  7. 10
      core/src/main/resources/com/github/weisj/darklaf/icons/menu/help.svg
  8. 10
      core/src/main/resources/com/github/weisj/darklaf/icons/menu/helpDisabled.svg
  9. 10
      core/src/main/resources/com/github/weisj/darklaf/icons/menu/helpHighlight.svg
  10. 3
      core/src/main/resources/com/github/weisj/darklaf/properties/icons/menu.properties
  11. 2
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/button.properties
  12. 4
      core/src/test/java/ui/ComponentDemo.java
  13. 6
      core/src/test/java/ui/button/ButtonDemo.java
  14. 83
      core/src/test/java/ui/button/HelpButtonDemo.java
  15. 3
      core/src/test/java/ui/checkBox/CheckBoxDemo.java
  16. 3
      core/src/test/java/ui/checkBox/TriCheckBoxDemo.java
  17. 3
      core/src/test/java/ui/popupMenu/PopupMenuDemo.java
  18. 3
      core/src/test/java/ui/radioButton/RadioButtonDemo.java

49
core/src/main/java/com/github/weisj/darklaf/components/help/HelpButton.java

@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package com.github.weisj.darklaf.components.help;
import javax.swing.*;
import com.github.weisj.darklaf.ui.button.DarkButtonUI;
import com.github.weisj.darklaf.util.DarkUIUtil;
public class HelpButton extends JButton {
public HelpButton() {
this(null);
}
public HelpButton(final String text) {
super(text);
init();
}
protected void init() {
putClientProperty(DarkButtonUI.KEY_SQUARE, true);
putClientProperty(DarkButtonUI.KEY_ROUND, true);
setIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpHighlight.svg"));
setDisabledIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpDisabled.svg"));
}
}

42
core/src/main/java/com/github/weisj/darklaf/components/help/HelpMenuItem.java

@ -0,0 +1,42 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package com.github.weisj.darklaf.components.help;
import javax.swing.*;
import com.github.weisj.darklaf.util.DarkUIUtil;
public class HelpMenuItem extends JMenuItem {
public HelpMenuItem(final String text) {
super(text);
init();
}
protected void init() {
setIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/help.svg"));
setDisabledIcon(DarkUIUtil.ICON_LOADER.getIcon("menu/helpDisabled.svg"));
}
}

19
core/src/main/java/com/github/weisj/darklaf/ui/button/ButtonConstants.java

@ -41,6 +41,7 @@ public interface ButtonConstants {
String KEY_THIN = "JButton.thin"; String KEY_THIN = "JButton.thin";
String KEY_NO_BORDERLESS_OVERWRITE = "JButton.noBorderlessOverwrite"; String KEY_NO_BORDERLESS_OVERWRITE = "JButton.noBorderlessOverwrite";
String KEY_CORNER = "JButton.cornerFlag"; String KEY_CORNER = "JButton.cornerFlag";
String KEY_ROUND = "JButton.round";
String KEY_LEFT_NEIGHBOUR = "JButton.leftNeighbour"; String KEY_LEFT_NEIGHBOUR = "JButton.leftNeighbour";
String KEY_RIGHT_NEIGHBOUR = "JButton.rightNeighbour"; String KEY_RIGHT_NEIGHBOUR = "JButton.rightNeighbour";
@ -64,6 +65,20 @@ public interface ButtonConstants {
return PropertyUtil.getBooleanProperty(c, KEY_VARIANT); return PropertyUtil.getBooleanProperty(c, KEY_VARIANT);
} }
static int chooseArcWithBorder(final Component c, final int arc, final int minimum,
final int squareArc, final int borderSize) {
return chooseArc(c, arc, minimum, squareArc, c.getHeight() - 2 * borderSize);
}
static int chooseArc(final Component c, final int arc, final int minimum,
final int squareArc, final int roundedArc) {
if (ButtonConstants.isNoArc(c)) return minimum;
if (ButtonConstants.isRound(c)) return roundedArc;
boolean square = ButtonConstants.isSquare(c);
boolean alt = ButtonConstants.chooseAlternativeArc(c);
return square ? alt ? arc : squareArc : alt ? squareArc : arc;
}
static boolean isNoArc(final Component c) { static boolean isNoArc(final Component c) {
return PropertyUtil.getBooleanProperty(c, KEY_NO_ARC); return PropertyUtil.getBooleanProperty(c, KEY_NO_ARC);
} }
@ -72,6 +87,10 @@ public interface ButtonConstants {
return PropertyUtil.getBooleanProperty(c, KEY_SQUARE); return PropertyUtil.getBooleanProperty(c, KEY_SQUARE);
} }
static boolean isRound(final Component c) {
return PropertyUtil.getBooleanProperty(c, KEY_ROUND);
}
static boolean isThin(final Component c) { static boolean isThin(final Component c) {
return PropertyUtil.getBooleanProperty(c, KEY_THIN) return PropertyUtil.getBooleanProperty(c, KEY_THIN)
|| (c instanceof AbstractButton && ButtonConstants.doConvertToBorderless((AbstractButton) c)); || (c instanceof AbstractButton && ButtonConstants.doConvertToBorderless((AbstractButton) c));

14
core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonBorder.java

@ -89,6 +89,7 @@ public class DarkButtonBorder implements Border, UIResource {
} }
public static boolean showDropShadow(final JComponent c) { public static boolean showDropShadow(final JComponent c) {
if (ButtonConstants.isRound(c)) return false;
return showDropShadow(getCornerFlag(c)); return showDropShadow(getCornerFlag(c));
} }
@ -104,17 +105,11 @@ public class DarkButtonBorder implements Border, UIResource {
} }
protected int getArc(final Component c) { protected int getArc(final Component c) {
if (ButtonConstants.isNoArc(c)) return 0; return ButtonConstants.chooseArcWithBorder(c, arc, 0, squareArc, getBorderSize());
boolean square = ButtonConstants.isSquare(c);
boolean alt = ButtonConstants.chooseAlternativeArc(c);
return square ? alt ? arc : squareArc : alt ? squareArc : arc;
} }
protected int getFocusArc(final Component c) { protected int getFocusArc(final Component c) {
if (ButtonConstants.isNoArc(c)) return minimumArc; return ButtonConstants.chooseArcWithBorder(c, focusArc, minimumArc, squareFocusArc, getBorderSize());
boolean square = ButtonConstants.isSquare(c);
boolean alt = ButtonConstants.chooseAlternativeArc(c);
return square ? alt ? focusArc : squareFocusArc : alt ? squareFocusArc : focusArc;
} }
public static AlignmentExt getCornerFlag(final Component component) { public static AlignmentExt getCornerFlag(final Component component) {
@ -180,9 +175,6 @@ public class DarkButtonBorder implements Border, UIResource {
paintNeighbourFocus(g2, c, width, height); paintNeighbourFocus(g2, c, width, height);
} }
config.restore(); config.restore();
// g.setColor(Color.GREEN);
// PaintUtil.drawRect(g, 0,0, width, height, 1);
} }
protected void paintNeighbourFocus(final Graphics2D g2, final Component c, protected void paintNeighbourFocus(final Graphics2D g2, final Component c,

3
core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonListener.java

@ -76,7 +76,8 @@ public class DarkButtonListener extends BasicButtonListener {
AbstractButton b = (AbstractButton) e.getSource(); AbstractButton b = (AbstractButton) e.getSource();
String key = e.getPropertyName(); String key = e.getPropertyName();
if (key.startsWith("JButton.")) { if (key.startsWith("JButton.")) {
b.invalidate(); b.doLayout();
b.repaint();
} }
} }
} }

14
core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java

@ -190,11 +190,10 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
final int arc, final int width, final int height) { final int arc, final int width, final int height) {
boolean showShadow = DarkButtonBorder.showDropShadow(c); boolean showShadow = DarkButtonBorder.showDropShadow(c);
int shadow = showShadow ? shadowHeight : 0; int shadow = showShadow ? shadowHeight : 0;
int effectiveArc = ButtonConstants.isSquare(c) && !ButtonConstants.chooseAlternativeArc(c) ? 0 : arc; int effectiveArc = ButtonConstants.chooseArcWithBorder(c, arc, 0, 0, borderSize);
AlignmentExt corner = DarkButtonBorder.getCornerFlag(c); AlignmentExt corner = DarkButtonBorder.getCornerFlag(c);
boolean focus = c.hasFocus() && c.isFocusPainted();
Rectangle bgRect = getEffectiveRect(width, height, c, -(effectiveArc + 1), corner, focus); Rectangle bgRect = getEffectiveRect(width, height, -(effectiveArc + 1), corner);
if (c.isEnabled() && showShadow && PaintUtil.getShadowComposite().getAlpha() != 0) { if (c.isEnabled() && showShadow && PaintUtil.getShadowComposite().getAlpha() != 0) {
g.setColor(shadowColor); g.setColor(shadowColor);
Composite comp = g.getComposite(); Composite comp = g.getComposite();
@ -223,8 +222,8 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
} }
} }
protected Rectangle getEffectiveRect(final int width, final int height, final AbstractButton c, protected Rectangle getEffectiveRect(final int width, final int height,
final int adjustment, final AlignmentExt corner, final boolean focus) { final int adjustment, final AlignmentExt corner) {
Insets insetMask = new Insets(borderSize, borderSize, Math.max(borderSize, shadowHeight), borderSize); Insets insetMask = new Insets(borderSize, borderSize, Math.max(borderSize, shadowHeight), borderSize);
if (corner != null) { if (corner != null) {
insetMask = corner.maskInsets(insetMask, adjustment); insetMask = corner.maskInsets(insetMask, adjustment);
@ -319,10 +318,7 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
} }
protected int getArc(final Component c) { protected int getArc(final Component c) {
if (ButtonConstants.isNoArc(c)) return 0; return ButtonConstants.chooseArc(c, arc, 0, squareArc, borderSize);
boolean square = ButtonConstants.isSquare(c);
boolean alt = ButtonConstants.chooseAlternativeArc(c);
return square ? alt ? arc : squareArc : alt ? squareArc : arc;
} }
protected Color getForeground(final AbstractButton button) { protected Color getForeground(final AbstractButton button) {

10
core/src/main/resources/com/github/weisj/darklaf/icons/menu/help.svg

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Icons.Help.color">
<stop offset="0" stop-color="#AFB1B3"/>
<stop offset="1" stop-color="#AFB1B3"/>
</linearGradient>
</defs>
<path fill="url(#Icons.Help.color)"
d="M7,14 L9,14 L9,12 L7,12 L7,14 Z M8,2 C5.79,2 4,3.79 4,6 L6,6 C6,4.9 6.9,4 8,4 C9.1,4 10,4.9 10,6 C10,8 7,7.75 7,11 L9,11 C9,8.75 12,8.5 12,6 C12,3.79 10.21,2 8,2 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 523 B

10
core/src/main/resources/com/github/weisj/darklaf/icons/menu/helpDisabled.svg

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Icons.Help.color">
<stop offset="0" stop-color="#6E6E6E"/>
<stop offset="1" stop-color="#6E6E6E"/>
</linearGradient>
</defs>
<path fill="url(#Icons.Help.color)"
d="M7,14 L9,14 L9,12 L7,12 L7,14 Z M8,2 C5.79,2 4,3.79 4,6 L6,6 C6,4.9 6.9,4 8,4 C9.1,4 10,4.9 10,6 C10,8 7,7.75 7,11 L9,11 C9,8.75 12,8.5 12,6 C12,3.79 10.21,2 8,2 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 523 B

10
core/src/main/resources/com/github/weisj/darklaf/icons/menu/helpHighlight.svg

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<defs id="colors">
<linearGradient id="Icons.HelpHighlight.color">
<stop offset="0" stop-color="#3592C4"/>
<stop offset="1" stop-color="#3592C4"/>
</linearGradient>
</defs>
<path fill="url(#Icons.HelpHighlight.color)"
d="M7,14 L9,14 L9,12 L7,12 L7,14 Z M8,2 C5.79,2 4,3.79 4,6 L6,6 C6,4.9 6.9,4 8,4 C9.1,4 10,4.9 10,6 C10,8 7,7.75 7,11 L9,11 C9,8.75 12,8.5 12,6 C12,3.79 10.21,2 8,2 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 541 B

3
core/src/main/resources/com/github/weisj/darklaf/properties/icons/menu.properties

@ -37,3 +37,6 @@ Icons.save.color = %menuIconEnabled
Icons.arrowUpSort.color = %menuIconEnabled Icons.arrowUpSort.color = %menuIconEnabled
Icons.arrowsUpDownSort.color = %menuIconEnabled Icons.arrowsUpDownSort.color = %menuIconEnabled
Icons.settings.color = %menuIconEnabled Icons.settings.color = %menuIconEnabled
Icons.Help.color = %menuIconEnabled
Icons.HelpHighlight.color = %questionIconColor
Icons.HelpDisabled.color = %menuIconDisabled

2
core/src/main/resources/com/github/weisj/darklaf/properties/ui/button.properties

@ -52,7 +52,7 @@ Button.shadowHeight = %shadowHeight
Button.borderInsets = 7,16,7,16 Button.borderInsets = 7,16,7,16
Button.thinBorderInsets = 4,8,4,8 Button.thinBorderInsets = 4,8,4,8
Button.squareThinBorderInsets = 4,4,4,4 Button.squareThinBorderInsets = 4,4,4,4
Button.squareBorderInsets = 6,6,6,6 Button.squareBorderInsets = 7,7,7,7
Button.onlyLabelInsets = 0,0,0,0 Button.onlyLabelInsets = 0,0,0,0
Button.borderlessRectangularInsets = 0,0,0,0 Button.borderlessRectangularInsets = 0,0,0,0

4
core/src/test/java/ui/ComponentDemo.java

@ -145,6 +145,10 @@ public interface ComponentDemo {
} }
default JMenuBar createMenuBar() { default JMenuBar createMenuBar() {
return getDefaultMenuBar();
}
static JMenuBar getDefaultMenuBar() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = new JMenuBar();
menuBar.add(createThemeMenu()); menuBar.add(createThemeMenu());
menuBar.add(createSettingsMenu()); menuBar.add(createSettingsMenu());

6
core/src/test/java/ui/button/ButtonDemo.java

@ -88,6 +88,12 @@ public class ButtonDemo implements ComponentDemo {
addActionListener(e -> button.putClientProperty(DarkButtonUI.KEY_SQUARE, isSelected())); addActionListener(e -> button.putClientProperty(DarkButtonUI.KEY_SQUARE, isSelected()));
} }
}); });
controlPanel.add(new JCheckBox(DarkButtonUI.KEY_ROUND) {
{
setSelected(false);
addActionListener(e -> button.putClientProperty(DarkButtonUI.KEY_ROUND, isSelected()));
}
});
controlPanel.add(new JCheckBox(DarkButtonUI.KEY_THIN) { controlPanel.add(new JCheckBox(DarkButtonUI.KEY_THIN) {
{ {
setSelected(false); setSelected(false);

83
core/src/test/java/ui/button/HelpButtonDemo.java

@ -0,0 +1,83 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ui.button;
import javax.swing.*;
import ui.ComponentDemo;
import ui.DemoPanel;
import com.github.weisj.darklaf.components.help.HelpButton;
import com.github.weisj.darklaf.components.help.HelpMenuItem;
public class HelpButtonDemo implements ComponentDemo {
public static void main(final String[] args) {
ComponentDemo.showDemo(new HelpButtonDemo());
}
@Override
public JComponent createComponent() {
JButton button = new HelpButton();
DemoPanel panel = new DemoPanel(button);
JPanel controlPanel = panel.addControls();
controlPanel.add(new JCheckBox("enabled") {
{
setSelected(button.isEnabled());
addActionListener(e -> button.setEnabled(isSelected()));
}
});
controlPanel.add(new JCheckBox("focusable") {
{
setSelected(button.isFocusable());
addActionListener(e -> button.setFocusable(isSelected()));
}
});
controlPanel.add(new JCheckBox("Rollover") {
{
setSelected(button.isRolloverEnabled());
addActionListener(e -> button.setRolloverEnabled(isSelected()));
}
});
return panel;
}
@Override
public JMenuBar createMenuBar() {
JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
menuBar.add(new JMenu("Help") {
{
add(new HelpMenuItem("View Help"));
}
});
return menuBar;
}
@Override
public String getTitle() {
return "Help Button Demo";
}
}

3
core/src/test/java/ui/checkBox/CheckBoxDemo.java

@ -86,8 +86,7 @@ public class CheckBoxDemo implements ComponentDemo {
@Override @Override
public JMenuBar createMenuBar() { public JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
menuBar.add(ComponentDemo.createThemeMenu());
menuBar.add(new JMenu("Demo") { menuBar.add(new JMenu("Demo") {
{ {
add(new JCheckBoxMenuItem("CheckBox menu item")); add(new JCheckBoxMenuItem("CheckBox menu item"));

3
core/src/test/java/ui/checkBox/TriCheckBoxDemo.java

@ -88,8 +88,7 @@ public class TriCheckBoxDemo implements ComponentDemo {
@Override @Override
public JMenuBar createMenuBar() { public JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
menuBar.add(ComponentDemo.createThemeMenu());
menuBar.add(new JMenu("Demo") { menuBar.add(new JMenu("Demo") {
{ {
add(new TristateCheckBoxMenuItem("TristateCheckBox menu item")); add(new TristateCheckBoxMenuItem("TristateCheckBox menu item"));

3
core/src/test/java/ui/popupMenu/PopupMenuDemo.java

@ -130,8 +130,7 @@ public class PopupMenuDemo implements ComponentDemo {
@Override @Override
public JMenuBar createMenuBar() { public JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
menuBar.add(ComponentDemo.createThemeMenu());
menuBar.add(new JMenu("CheckBoxes") { menuBar.add(new JMenu("CheckBoxes") {
{ {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {

3
core/src/test/java/ui/radioButton/RadioButtonDemo.java

@ -86,8 +86,7 @@ public class RadioButtonDemo implements ComponentDemo {
@Override @Override
public JMenuBar createMenuBar() { public JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = ComponentDemo.getDefaultMenuBar();
menuBar.add(ComponentDemo.createThemeMenu());
menuBar.add(new JMenu("Demo") { menuBar.add(new JMenu("Demo") {
{ {
add(new JRadioButtonMenuItem("RadioButton menu item")); add(new JRadioButtonMenuItem("RadioButton menu item"));

Loading…
Cancel
Save