FlatWindowDecorationsTest: redesigned UI; added "FlatLaf window decorations" checkbox

This commit is contained in:
Karl Tauber
2023-07-02 18:03:39 +02:00
parent aa4c6ee9da
commit 11c02e5f50
2 changed files with 427 additions and 345 deletions

View File

@@ -26,7 +26,9 @@ import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.components.FlatTriStateCheckBox;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
@@ -132,6 +134,10 @@ public class FlatWindowDecorationsTest
styleFileChooserRadioButton.setSelected( true );
}
private void windowDecorationsChanged() {
FlatLaf.setUseNativeWindowDecorations( windowDecorationsCheckBox.isSelected() );
}
private void unifiedBackgroundChanged() {
UIManager.put( "TitlePane.unifiedBackground", unifiedBackgroundCheckBox.isSelected() );
Window window = SwingUtilities.windowForComponent( this );
@@ -482,8 +488,24 @@ debug*/
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JPanel panel7 = new JPanel();
windowDecorationsCheckBox = new JCheckBox();
resizableCheckBox = new JCheckBox();
undecoratedCheckBox = new JCheckBox();
fullScreenCheckBox = new JCheckBox();
maximizedBoundsCheckBox = new JCheckBox();
JPanel panel4 = new JPanel();
showIconCheckBox = new FlatTriStateCheckBox();
showTitleCheckBox = new JCheckBox();
showIconifyCheckBox = new JCheckBox();
showMaximizeCheckBox = new JCheckBox();
showCloseCheckBox = new JCheckBox();
JPanel panel6 = new JPanel();
menuBarCheckBox = new JCheckBox();
menuBarEmbeddedCheckBox = new JCheckBox();
menuBarVisibleCheckBox = new JCheckBox();
rightCompCheckBox = new JCheckBox();
rightStretchCompCheckBox = new JCheckBox();
JPanel panel3 = new JPanel();
addMenuButton = new JButton();
addGlueButton = new JButton();
@@ -491,19 +513,6 @@ debug*/
removeMenuButton = new JButton();
changeMenuButton = new JButton();
changeTitleButton = new JButton();
menuBarEmbeddedCheckBox = new JCheckBox();
rightStretchCompCheckBox = new JCheckBox();
menuBarVisibleCheckBox = new JCheckBox();
colorizeMenuBarCheckBox = new JCheckBox();
unifiedBackgroundCheckBox = new JCheckBox();
colorizeMenusCheckBox = new JCheckBox();
colorizeTitleBarCheckBox = new JCheckBox();
resizableCheckBox = new JCheckBox();
maximizedBoundsCheckBox = new JCheckBox();
undecoratedCheckBox = new JCheckBox();
fullScreenCheckBox = new JCheckBox();
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
JPanel panel1 = new JPanel();
styleNoneRadioButton = new JRadioButton();
styleFrameRadioButton = new JRadioButton();
@@ -520,12 +529,11 @@ debug*/
iconTestRandomRadioButton = new JRadioButton();
iconTestMRIRadioButton = new JRadioButton();
iconTestDynMRIRadioButton = new JRadioButton();
JPanel panel4 = new JPanel();
showIconCheckBox = new FlatTriStateCheckBox();
showTitleCheckBox = new JCheckBox();
showIconifyCheckBox = new JCheckBox();
showMaximizeCheckBox = new JCheckBox();
showCloseCheckBox = new JCheckBox();
JPanel panel5 = new JPanel();
unifiedBackgroundCheckBox = new JCheckBox();
colorizeTitleBarCheckBox = new JCheckBox();
colorizeMenuBarCheckBox = new JCheckBox();
colorizeMenusCheckBox = new JCheckBox();
JButton openDialogButton = new JButton();
JButton openFrameButton = new JButton();
menuBar = new JMenuBar();
@@ -559,31 +567,146 @@ debug*/
setLayout(new MigLayout(
"ltr,insets dialog,hidemode 3",
// columns
"[left]para" +
"[left]" +
"[fill]" +
"[fill]" +
"[fill]" +
"[fill]",
// rows
"para[]0" +
"[]0" +
"[]0" +
"[]0" +
"[]unrel" +
"[]0" +
"[]unrel" +
"[]" +
"[top]" +
"[fill]" +
"[fill]" +
"[]"));
//---- menuBarCheckBox ----
menuBarCheckBox.setText("menu bar");
menuBarCheckBox.setSelected(true);
menuBarCheckBox.addActionListener(e -> menuBarChanged());
add(menuBarCheckBox, "cell 0 0");
//======== panel7 ========
{
panel7.setBorder(new TitledBorder("Window"));
panel7.setLayout(new MigLayout(
"ltr,hidemode 3,gap 0 0",
// columns
"[left]",
// rows
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- rightCompCheckBox ----
rightCompCheckBox.setText("right aligned component");
rightCompCheckBox.addActionListener(e -> rightCompChanged());
add(rightCompCheckBox, "cell 1 0");
//---- windowDecorationsCheckBox ----
windowDecorationsCheckBox.setText("FlatLaf window decorations");
windowDecorationsCheckBox.setSelected(true);
windowDecorationsCheckBox.addActionListener(e -> windowDecorationsChanged());
panel7.add(windowDecorationsCheckBox, "cell 0 0");
//---- resizableCheckBox ----
resizableCheckBox.setText("resizable");
resizableCheckBox.setSelected(true);
resizableCheckBox.addActionListener(e -> resizableChanged());
panel7.add(resizableCheckBox, "cell 0 1");
//---- undecoratedCheckBox ----
undecoratedCheckBox.setText("undecorated");
undecoratedCheckBox.addActionListener(e -> undecoratedChanged());
panel7.add(undecoratedCheckBox, "cell 0 2");
//---- fullScreenCheckBox ----
fullScreenCheckBox.setText("full screen");
fullScreenCheckBox.addActionListener(e -> fullScreenChanged());
panel7.add(fullScreenCheckBox, "cell 0 3");
//---- maximizedBoundsCheckBox ----
maximizedBoundsCheckBox.setText("maximized bounds (50,100, 1000,700)");
maximizedBoundsCheckBox.addActionListener(e -> maximizedBoundsChanged());
panel7.add(maximizedBoundsCheckBox, "cell 0 4");
}
add(panel7, "cell 0 0");
//======== panel4 ========
{
panel4.setBorder(new TitledBorder("Title Bar"));
panel4.setLayout(new MigLayout(
"ltr,hidemode 3,gap 0 0",
// columns
"[grow,left]",
// rows
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- showIconCheckBox ----
showIconCheckBox.setText("show icon");
showIconCheckBox.addActionListener(e -> showIconChanged());
panel4.add(showIconCheckBox, "cell 0 0");
//---- showTitleCheckBox ----
showTitleCheckBox.setText("show title");
showTitleCheckBox.setSelected(true);
showTitleCheckBox.addActionListener(e -> showTitleChanged());
panel4.add(showTitleCheckBox, "cell 0 1");
//---- showIconifyCheckBox ----
showIconifyCheckBox.setText("show iconfiy");
showIconifyCheckBox.setSelected(true);
showIconifyCheckBox.addActionListener(e -> showIconifyChanged());
panel4.add(showIconifyCheckBox, "cell 0 2");
//---- showMaximizeCheckBox ----
showMaximizeCheckBox.setText("show maximize");
showMaximizeCheckBox.setSelected(true);
showMaximizeCheckBox.addActionListener(e -> showMaximizeChanged());
panel4.add(showMaximizeCheckBox, "cell 0 3");
//---- showCloseCheckBox ----
showCloseCheckBox.setText("show close");
showCloseCheckBox.setSelected(true);
showCloseCheckBox.addActionListener(e -> showCloseChanged());
panel4.add(showCloseCheckBox, "cell 0 4");
}
add(panel4, "cell 1 0");
//======== panel6 ========
{
panel6.setBorder(new TitledBorder("Menu Bar"));
panel6.setLayout(new MigLayout(
"ltr,hidemode 3,gap 0 0",
// columns
"[left]",
// rows
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- menuBarCheckBox ----
menuBarCheckBox.setText("menu bar");
menuBarCheckBox.setSelected(true);
menuBarCheckBox.addActionListener(e -> menuBarChanged());
panel6.add(menuBarCheckBox, "cell 0 0");
//---- menuBarEmbeddedCheckBox ----
menuBarEmbeddedCheckBox.setText("embedded menu bar");
menuBarEmbeddedCheckBox.setSelected(true);
menuBarEmbeddedCheckBox.addActionListener(e -> menuBarEmbeddedChanged());
panel6.add(menuBarEmbeddedCheckBox, "cell 0 1");
//---- menuBarVisibleCheckBox ----
menuBarVisibleCheckBox.setText("menu bar visible");
menuBarVisibleCheckBox.setSelected(true);
menuBarVisibleCheckBox.addActionListener(e -> menuBarVisibleChanged());
panel6.add(menuBarVisibleCheckBox, "cell 0 2");
//---- rightCompCheckBox ----
rightCompCheckBox.setText("right aligned component");
rightCompCheckBox.addActionListener(e -> rightCompChanged());
panel6.add(rightCompCheckBox, "cell 0 3");
//---- rightStretchCompCheckBox ----
rightStretchCompCheckBox.setText("right aligned stretching component");
rightStretchCompCheckBox.addActionListener(e -> rightStretchCompChanged());
panel6.add(rightStretchCompCheckBox, "cell 0 4");
}
add(panel6, "cell 2 0");
//======== panel3 ========
{
@@ -629,80 +752,15 @@ debug*/
changeTitleButton.addActionListener(e -> changeTitle());
panel3.add(changeTitleButton, "cell 0 5");
}
add(panel3, "cell 2 0 1 8,aligny top,growy 0");
//---- menuBarEmbeddedCheckBox ----
menuBarEmbeddedCheckBox.setText("embedded menu bar");
menuBarEmbeddedCheckBox.setSelected(true);
menuBarEmbeddedCheckBox.addActionListener(e -> menuBarEmbeddedChanged());
add(menuBarEmbeddedCheckBox, "cell 0 1");
//---- rightStretchCompCheckBox ----
rightStretchCompCheckBox.setText("right aligned stretching component");
rightStretchCompCheckBox.addActionListener(e -> rightStretchCompChanged());
add(rightStretchCompCheckBox, "cell 1 1");
//---- menuBarVisibleCheckBox ----
menuBarVisibleCheckBox.setText("menu bar visible");
menuBarVisibleCheckBox.setSelected(true);
menuBarVisibleCheckBox.addActionListener(e -> menuBarVisibleChanged());
add(menuBarVisibleCheckBox, "cell 0 2");
//---- colorizeMenuBarCheckBox ----
colorizeMenuBarCheckBox.setText("colorize menu bar");
colorizeMenuBarCheckBox.addActionListener(e -> colorizeMenuBar());
add(colorizeMenuBarCheckBox, "cell 1 2");
//---- unifiedBackgroundCheckBox ----
unifiedBackgroundCheckBox.setText("unified background");
unifiedBackgroundCheckBox.addActionListener(e -> unifiedBackgroundChanged());
add(unifiedBackgroundCheckBox, "cell 0 3");
//---- colorizeMenusCheckBox ----
colorizeMenusCheckBox.setText("colorize menus");
colorizeMenusCheckBox.addActionListener(e -> colorizeMenus());
add(colorizeMenusCheckBox, "cell 1 3");
//---- colorizeTitleBarCheckBox ----
colorizeTitleBarCheckBox.setText("colorize title bar");
colorizeTitleBarCheckBox.addActionListener(e -> colorizeTitleBar());
add(colorizeTitleBarCheckBox, "cell 0 4");
//---- resizableCheckBox ----
resizableCheckBox.setText("resizable");
resizableCheckBox.setSelected(true);
resizableCheckBox.addActionListener(e -> resizableChanged());
add(resizableCheckBox, "cell 0 5");
//---- maximizedBoundsCheckBox ----
maximizedBoundsCheckBox.setText("maximized bounds (50,100, 1000,700)");
maximizedBoundsCheckBox.addActionListener(e -> maximizedBoundsChanged());
add(maximizedBoundsCheckBox, "cell 1 5");
//---- undecoratedCheckBox ----
undecoratedCheckBox.setText("undecorated");
undecoratedCheckBox.addActionListener(e -> undecoratedChanged());
add(undecoratedCheckBox, "cell 0 6");
//---- fullScreenCheckBox ----
fullScreenCheckBox.setText("full screen");
fullScreenCheckBox.addActionListener(e -> fullScreenChanged());
add(fullScreenCheckBox, "cell 1 6");
//---- label1 ----
label1.setText("Style:");
add(label1, "cell 0 7");
//---- label2 ----
label2.setText("Icon:");
add(label2, "cell 1 7");
add(panel3, "cell 3 0 1 2,aligny top,growy 0");
//======== panel1 ========
{
panel1.setBorder(new TitledBorder("Window Decoration Style"));
panel1.setLayout(new MigLayout(
"ltr,insets 0,hidemode 3,gap 0 0",
"ltr,hidemode 3,gap 0 0",
// columns
"[fill]",
"[left]",
// rows
"[]" +
"[]" +
@@ -760,12 +818,13 @@ debug*/
styleFileChooserRadioButton.addActionListener(e -> decorationStyleChanged());
panel1.add(styleFileChooserRadioButton, "cell 0 8");
}
add(panel1, "cell 0 8");
add(panel1, "cell 0 1");
//======== panel2 ========
{
panel2.setBorder(new TitledBorder("Window Icon"));
panel2.setLayout(new MigLayout(
"ltr,insets 0,hidemode 3,gap 0 0",
"ltr,hidemode 3,gap 0 0",
// columns
"[left]",
// rows
@@ -773,7 +832,6 @@ debug*/
"[]" +
"[]" +
"[]" +
"[]rel" +
"[]"));
//---- iconNoneRadioButton ----
@@ -802,62 +860,53 @@ debug*/
iconTestDynMRIRadioButton.addActionListener(e -> iconChanged());
panel2.add(iconTestDynMRIRadioButton, "cell 0 4");
}
add(panel2, "cell 1 8");
add(panel2, "cell 1 1");
//======== panel4 ========
//======== panel5 ========
{
panel4.setLayout(new MigLayout(
"ltr,insets 0,hidemode 3,gap 0 0",
panel5.setBorder(new TitledBorder("Color"));
panel5.setLayout(new MigLayout(
"ltr,hidemode 3,gap 0 0",
// columns
"[grow,left]",
"[left]",
// rows
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- showIconCheckBox ----
showIconCheckBox.setText("show icon");
showIconCheckBox.addActionListener(e -> showIconChanged());
panel4.add(showIconCheckBox, "cell 0 0");
//---- unifiedBackgroundCheckBox ----
unifiedBackgroundCheckBox.setText("unified background");
unifiedBackgroundCheckBox.addActionListener(e -> unifiedBackgroundChanged());
panel5.add(unifiedBackgroundCheckBox, "cell 0 0");
//---- showTitleCheckBox ----
showTitleCheckBox.setText("show title");
showTitleCheckBox.setSelected(true);
showTitleCheckBox.addActionListener(e -> showTitleChanged());
panel4.add(showTitleCheckBox, "cell 0 1");
//---- colorizeTitleBarCheckBox ----
colorizeTitleBarCheckBox.setText("colorize title bar");
colorizeTitleBarCheckBox.addActionListener(e -> colorizeTitleBar());
panel5.add(colorizeTitleBarCheckBox, "cell 0 1");
//---- showIconifyCheckBox ----
showIconifyCheckBox.setText("show iconfiy");
showIconifyCheckBox.setSelected(true);
showIconifyCheckBox.addActionListener(e -> showIconifyChanged());
panel4.add(showIconifyCheckBox, "cell 0 2");
//---- colorizeMenuBarCheckBox ----
colorizeMenuBarCheckBox.setText("colorize menu bar");
colorizeMenuBarCheckBox.addActionListener(e -> colorizeMenuBar());
panel5.add(colorizeMenuBarCheckBox, "cell 0 2");
//---- showMaximizeCheckBox ----
showMaximizeCheckBox.setText("show maximize");
showMaximizeCheckBox.setSelected(true);
showMaximizeCheckBox.addActionListener(e -> showMaximizeChanged());
panel4.add(showMaximizeCheckBox, "cell 0 3");
//---- showCloseCheckBox ----
showCloseCheckBox.setText("show close");
showCloseCheckBox.setSelected(true);
showCloseCheckBox.addActionListener(e -> showCloseChanged());
panel4.add(showCloseCheckBox, "cell 0 4");
//---- colorizeMenusCheckBox ----
colorizeMenusCheckBox.setText("colorize menus");
colorizeMenusCheckBox.addActionListener(e -> colorizeMenus());
panel5.add(colorizeMenusCheckBox, "cell 0 3");
}
add(panel4, "cell 2 8");
add(panel5, "cell 2 1");
//---- openDialogButton ----
openDialogButton.setText("Open Dialog");
openDialogButton.addActionListener(e -> openDialog());
add(openDialogButton, "cell 0 9 2 1");
add(openDialogButton, "cell 0 2");
//---- openFrameButton ----
openFrameButton.setText("Open Frame");
openFrameButton.setMnemonic('A');
openFrameButton.addActionListener(e -> openFrame());
add(openFrameButton, "cell 0 9 2 1");
add(openFrameButton, "cell 0 2");
//======== menuBar ========
{
@@ -1050,25 +1099,27 @@ debug*/
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JCheckBox windowDecorationsCheckBox;
private JCheckBox resizableCheckBox;
private JCheckBox undecoratedCheckBox;
private JCheckBox fullScreenCheckBox;
private JCheckBox maximizedBoundsCheckBox;
private FlatTriStateCheckBox showIconCheckBox;
private JCheckBox showTitleCheckBox;
private JCheckBox showIconifyCheckBox;
private JCheckBox showMaximizeCheckBox;
private JCheckBox showCloseCheckBox;
private JCheckBox menuBarCheckBox;
private JCheckBox menuBarEmbeddedCheckBox;
private JCheckBox menuBarVisibleCheckBox;
private JCheckBox rightCompCheckBox;
private JCheckBox rightStretchCompCheckBox;
private JButton addMenuButton;
private JButton addGlueButton;
private JButton addCaptionButton;
private JButton removeMenuButton;
private JButton changeMenuButton;
private JButton changeTitleButton;
private JCheckBox menuBarEmbeddedCheckBox;
private JCheckBox rightStretchCompCheckBox;
private JCheckBox menuBarVisibleCheckBox;
private JCheckBox colorizeMenuBarCheckBox;
private JCheckBox unifiedBackgroundCheckBox;
private JCheckBox colorizeMenusCheckBox;
private JCheckBox colorizeTitleBarCheckBox;
private JCheckBox resizableCheckBox;
private JCheckBox maximizedBoundsCheckBox;
private JCheckBox undecoratedCheckBox;
private JCheckBox fullScreenCheckBox;
private JRadioButton styleNoneRadioButton;
private JRadioButton styleFrameRadioButton;
private JRadioButton stylePlainRadioButton;
@@ -1083,11 +1134,10 @@ debug*/
private JRadioButton iconTestRandomRadioButton;
private JRadioButton iconTestMRIRadioButton;
private JRadioButton iconTestDynMRIRadioButton;
private FlatTriStateCheckBox showIconCheckBox;
private JCheckBox showTitleCheckBox;
private JCheckBox showIconifyCheckBox;
private JCheckBox showMaximizeCheckBox;
private JCheckBox showCloseCheckBox;
private JCheckBox unifiedBackgroundCheckBox;
private JCheckBox colorizeTitleBarCheckBox;
private JCheckBox colorizeMenuBarCheckBox;
private JCheckBox colorizeMenusCheckBox;
private JMenuBar menuBar;
// JFormDesigner - End of variables declaration //GEN-END:variables
}

View File

@@ -8,31 +8,199 @@ new FormModel {
}
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
"$columnConstraints": "[left]para[left][fill]"
"$rowConstraints": "para[]0[]0[]0[]0[]unrel[]0[]unrel[][top][]"
"$columnConstraints": "[fill][fill][fill][fill]"
"$rowConstraints": "[fill][fill][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarCheckBox"
"text": "menu bar"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarChanged", false ) )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
"$columnConstraints": "[left]"
"$rowConstraints": "[][][][][]"
} ) {
name: "panel7"
"border": new javax.swing.border.TitledBorder( "Window" )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "windowDecorationsCheckBox"
"text": "FlatLaf window decorations"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "windowDecorationsChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "resizableCheckBox"
"text": "resizable"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "undecoratedCheckBox"
"text": "undecorated"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "undecoratedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "fullScreenCheckBox"
"text": "full screen"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "fullScreenChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "maximizedBoundsCheckBox"
"text": "maximized bounds (50,100, 1000,700)"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximizedBoundsChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "rightCompCheckBox"
"text": "right aligned component"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightCompChanged", false ) )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
"$columnConstraints": "[grow,left]"
"$rowConstraints": "[][][][][]"
} ) {
name: "panel4"
"border": new javax.swing.border.TitledBorder( "Title Bar" )
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTriStateCheckBox" ) {
name: "showIconCheckBox"
"text": "show icon"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showIconChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showTitleCheckBox"
"text": "show title"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTitleChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showIconifyCheckBox"
"text": "show iconfiy"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showIconifyChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showMaximizeCheckBox"
"text": "show maximize"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showMaximizeChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showCloseCheckBox"
"text": "show close"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showCloseChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
"$columnConstraints": "[left]"
"$rowConstraints": "[][][][][]"
} ) {
name: "panel6"
"border": new javax.swing.border.TitledBorder( "Menu Bar" )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarCheckBox"
"text": "menu bar"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarEmbeddedCheckBox"
"text": "embedded menu bar"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarVisibleCheckBox"
"text": "menu bar visible"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarVisibleChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "rightCompCheckBox"
"text": "right aligned component"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightCompChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "rightStretchCompCheckBox"
"text": "right aligned stretching component"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightStretchCompChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "hidemode 3"
"$columnConstraints": "[fill]"
@@ -100,139 +268,15 @@ new FormModel {
"value": "cell 0 5"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0 1 8,aligny top,growy 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarEmbeddedCheckBox"
"text": "embedded menu bar"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarEmbeddedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "rightStretchCompCheckBox"
"text": "right aligned stretching component"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightStretchCompChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "menuBarVisibleCheckBox"
"text": "menu bar visible"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "menuBarVisibleChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeMenuBarCheckBox"
"text": "colorize menu bar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenuBar", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "unifiedBackgroundCheckBox"
"text": "unified background"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "unifiedBackgroundChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeMenusCheckBox"
"text": "colorize menus"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenus", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "colorizeTitleBarCheckBox"
"text": "colorize title bar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeTitleBar", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "resizableCheckBox"
"text": "resizable"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "resizableChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "maximizedBoundsCheckBox"
"text": "maximized bounds (50,100, 1000,700)"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "maximizedBoundsChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "undecoratedCheckBox"
"text": "undecorated"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "undecoratedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "fullScreenCheckBox"
"text": "full screen"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "fullScreenChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 6"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "Style:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label2"
"text": "Icon:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7"
"value": "cell 3 0 1 2,aligny top,growy 0"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[fill]"
"$columnConstraints": "[left]"
"$rowConstraints": "[][][][][][][][][]"
"$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0"
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
} ) {
name: "panel1"
"border": new javax.swing.border.TitledBorder( "Window Decoration Style" )
add( new FormComponent( "javax.swing.JRadioButton" ) {
name: "styleNoneRadioButton"
"text": "none"
@@ -334,14 +378,15 @@ new FormModel {
"value": "cell 0 8"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 8"
"value": "cell 0 1"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[left]"
"$rowConstraints": "[][][][][]rel[]"
"$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0"
"$rowConstraints": "[][][][][]"
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
} ) {
name: "panel2"
"border": new javax.swing.border.TitledBorder( "Window Icon" )
add( new FormComponent( "javax.swing.JRadioButton" ) {
name: "iconNoneRadioButton"
"text": "none"
@@ -399,77 +444,64 @@ new FormModel {
"value": "cell 0 4"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 8"
"value": "cell 1 1"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,insets 0,hidemode 3,gap 0 0"
"$columnConstraints": "[grow,left]"
"$rowConstraints": "[][][][][]"
"$layoutConstraints": "ltr,hidemode 3,gap 0 0"
"$columnConstraints": "[left]"
"$rowConstraints": "[][][][]"
} ) {
name: "panel4"
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTriStateCheckBox" ) {
name: "showIconCheckBox"
"text": "show icon"
name: "panel5"
"border": new javax.swing.border.TitledBorder( "Color" )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "unifiedBackgroundCheckBox"
"text": "unified background"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showIconChanged", false ) )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "unifiedBackgroundChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showTitleCheckBox"
"text": "show title"
"selected": true
name: "colorizeTitleBarCheckBox"
"text": "colorize title bar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTitleChanged", false ) )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeTitleBar", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showIconifyCheckBox"
"text": "show iconfiy"
"selected": true
name: "colorizeMenuBarCheckBox"
"text": "colorize menu bar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showIconifyChanged", false ) )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenuBar", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showMaximizeCheckBox"
"text": "show maximize"
"selected": true
name: "colorizeMenusCheckBox"
"text": "colorize menus"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showMaximizeChanged", false ) )
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "colorizeMenus", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showCloseCheckBox"
"text": "show close"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showCloseChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 8"
"value": "cell 2 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "openDialogButton"
"text": "Open Dialog"
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openDialog", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 9 2 1"
"value": "cell 0 2"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "openFrameButton"
@@ -477,11 +509,11 @@ new FormModel {
"mnemonic": 65
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "openFrame", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 9 2 1"
"value": "cell 0 2"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 690, 495 )
"size": new java.awt.Dimension( 960, 495 )
} )
add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) {
name: "menuBar"