mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 23:37:13 -06:00
Testing: added font size spinner to control bar; also support Ctrl+0, Ctrl++ and Ctrl+- to change font size
This commit is contained in:
@@ -149,6 +149,7 @@ public class FlatTestFrame
|
|||||||
if( scaleFactor != null )
|
if( scaleFactor != null )
|
||||||
scaleFactorComboBox.setSelectedItem( scaleFactor );
|
scaleFactorComboBox.setSelectedItem( scaleFactor );
|
||||||
|
|
||||||
|
updateFontSizeSpinner();
|
||||||
updateSizeVariantComboBox();
|
updateSizeVariantComboBox();
|
||||||
|
|
||||||
// register F1, F2, ... keys to switch to Light, Dark or other LaFs
|
// register F1, F2, ... keys to switch to Light, Dark or other LaFs
|
||||||
@@ -168,6 +169,21 @@ public class FlatTestFrame
|
|||||||
registerSwitchToLookAndFeel( "F12", MetalLookAndFeel.class.getName() );
|
registerSwitchToLookAndFeel( "F12", MetalLookAndFeel.class.getName() );
|
||||||
registerSwitchToLookAndFeel( "F11", NimbusLookAndFeel.class.getName() );
|
registerSwitchToLookAndFeel( "F11", NimbusLookAndFeel.class.getName() );
|
||||||
|
|
||||||
|
// register Ctrl+0, Ctrl++ and Ctrl+- to change font size
|
||||||
|
int menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
||||||
|
((JComponent)getContentPane()).registerKeyboardAction(
|
||||||
|
e -> restoreFont(),
|
||||||
|
KeyStroke.getKeyStroke( KeyEvent.VK_0, menuShortcutKeyMask ),
|
||||||
|
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||||
|
((JComponent)getContentPane()).registerKeyboardAction(
|
||||||
|
e -> incrFont(),
|
||||||
|
KeyStroke.getKeyStroke( KeyEvent.VK_PLUS, menuShortcutKeyMask ),
|
||||||
|
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||||
|
((JComponent)getContentPane()).registerKeyboardAction(
|
||||||
|
e -> decrFont(),
|
||||||
|
KeyStroke.getKeyStroke( KeyEvent.VK_MINUS, menuShortcutKeyMask ),
|
||||||
|
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
|
||||||
|
|
||||||
// register ESC key to close frame
|
// register ESC key to close frame
|
||||||
((JComponent)getContentPane()).registerKeyboardAction(
|
((JComponent)getContentPane()).registerKeyboardAction(
|
||||||
e -> {
|
e -> {
|
||||||
@@ -207,6 +223,9 @@ public class FlatTestFrame
|
|||||||
// enable/disable scale factor combobox
|
// enable/disable scale factor combobox
|
||||||
updateScaleFactorComboBox();
|
updateScaleFactorComboBox();
|
||||||
|
|
||||||
|
// enable/disable font size spinner
|
||||||
|
updateFontSizeSpinner();
|
||||||
|
|
||||||
// show/hide size variant combobox
|
// show/hide size variant combobox
|
||||||
updateSizeVariantComboBox();
|
updateSizeVariantComboBox();
|
||||||
|
|
||||||
@@ -299,14 +318,27 @@ public class FlatTestFrame
|
|||||||
private void applyLookAndFeel( String lafClassName, IntelliJTheme theme, boolean pack ) {
|
private void applyLookAndFeel( String lafClassName, IntelliJTheme theme, boolean pack ) {
|
||||||
EventQueue.invokeLater( () -> {
|
EventQueue.invokeLater( () -> {
|
||||||
try {
|
try {
|
||||||
|
// clear custom default font before switching to other LaF
|
||||||
|
Font defaultFont = null;
|
||||||
|
if( UIManager.getLookAndFeel() instanceof FlatLaf ) {
|
||||||
|
Font font = UIManager.getFont( "defaultFont" );
|
||||||
|
if( font != UIManager.getLookAndFeelDefaults().getFont( "defaultFont" ) )
|
||||||
|
defaultFont = font;
|
||||||
|
}
|
||||||
|
UIManager.put( "defaultFont", null );
|
||||||
|
|
||||||
// change look and feel
|
// change look and feel
|
||||||
if( theme != null )
|
if( theme != null )
|
||||||
UIManager.setLookAndFeel( IntelliJTheme.createLaf( theme ) );
|
UIManager.setLookAndFeel( IntelliJTheme.createLaf( theme ) );
|
||||||
else
|
else
|
||||||
UIManager.setLookAndFeel( lafClassName );
|
UIManager.setLookAndFeel( lafClassName );
|
||||||
|
|
||||||
|
// restore custom default font when switched to other FlatLaf LaF
|
||||||
|
if( defaultFont != null && UIManager.getLookAndFeel() instanceof FlatLaf )
|
||||||
|
UIManager.put( "defaultFont", defaultFont );
|
||||||
|
|
||||||
// update all components
|
// update all components
|
||||||
FlatLaf.updateUI();
|
updateUI2();
|
||||||
|
|
||||||
// increase size of frame if necessary
|
// increase size of frame if necessary
|
||||||
if( pack )
|
if( pack )
|
||||||
@@ -343,6 +375,25 @@ public class FlatTestFrame
|
|||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void updateUI2() {
|
||||||
|
KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||||
|
Component permanentFocusOwner = keyboardFocusManager.getPermanentFocusOwner();
|
||||||
|
JSpinner spinner = (permanentFocusOwner != null)
|
||||||
|
? (JSpinner) SwingUtilities.getAncestorOfClass( JSpinner.class, permanentFocusOwner )
|
||||||
|
: null;
|
||||||
|
|
||||||
|
FlatLaf.updateUI();
|
||||||
|
|
||||||
|
if( spinner != null && keyboardFocusManager.getPermanentFocusOwner() == null ) {
|
||||||
|
JComponent editor = spinner.getEditor();
|
||||||
|
JTextField textField = (editor instanceof JSpinner.DefaultEditor)
|
||||||
|
? ((JSpinner.DefaultEditor)editor).getTextField()
|
||||||
|
: null;
|
||||||
|
if( textField != null )
|
||||||
|
textField.requestFocusInWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void explicitColorsChanged() {
|
private void explicitColorsChanged() {
|
||||||
EventQueue.invokeLater( () -> {
|
EventQueue.invokeLater( () -> {
|
||||||
boolean explicit = explicitColorsCheckBox.isSelected();
|
boolean explicit = explicitColorsCheckBox.isSelected();
|
||||||
@@ -425,6 +476,9 @@ public class FlatTestFrame
|
|||||||
DemoPrefs.getState().remove( KEY_SCALE_FACTOR );
|
DemoPrefs.getState().remove( KEY_SCALE_FACTOR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// always clear default font because a new font size is computed based on the scale factor
|
||||||
|
UIManager.put( "defaultFont", null );
|
||||||
|
|
||||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||||
IntelliJTheme theme = (lookAndFeel instanceof IntelliJTheme.ThemeLaf)
|
IntelliJTheme theme = (lookAndFeel instanceof IntelliJTheme.ThemeLaf)
|
||||||
? ((IntelliJTheme.ThemeLaf)lookAndFeel).getTheme()
|
? ((IntelliJTheme.ThemeLaf)lookAndFeel).getTheme()
|
||||||
@@ -436,6 +490,43 @@ public class FlatTestFrame
|
|||||||
scaleFactorComboBox.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf );
|
scaleFactorComboBox.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void restoreFont() {
|
||||||
|
fontSizeSpinner.setValue( 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void incrFont() {
|
||||||
|
fontSizeSpinner.setValue( fontSizeSpinner.getNextValue() );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void decrFont() {
|
||||||
|
fontSizeSpinner.setValue( fontSizeSpinner.getPreviousValue() );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fontSizeChanged() {
|
||||||
|
if( !(UIManager.getLookAndFeel() instanceof FlatLaf) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Object value = fontSizeSpinner.getValue();
|
||||||
|
int newFontSize = (value instanceof Integer) ? (Integer) value : 0;
|
||||||
|
|
||||||
|
Font font = UIManager.getFont( "defaultFont" );
|
||||||
|
if( font == null || font.getSize() == newFontSize )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Font newFont = (newFontSize >= 8) ? font.deriveFont( (float) newFontSize ) : null;
|
||||||
|
UIManager.put( "defaultFont", newFont );
|
||||||
|
|
||||||
|
if( newFont == null )
|
||||||
|
updateFontSizeSpinner();
|
||||||
|
|
||||||
|
updateUI2();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFontSizeSpinner() {
|
||||||
|
fontSizeSpinner.setEnabled( UIManager.getLookAndFeel() instanceof FlatLaf );
|
||||||
|
fontSizeSpinner.setValue( UIManager.getFont( "Label.font" ).getSize() );
|
||||||
|
}
|
||||||
|
|
||||||
private void sizeVariantChanged() {
|
private void sizeVariantChanged() {
|
||||||
String sel = (String) sizeVariantComboBox.getSelectedItem();
|
String sel = (String) sizeVariantComboBox.getSelectedItem();
|
||||||
String sizeVariant = "default".equals( sel ) ? null : sel;
|
String sizeVariant = "default".equals( sel ) ? null : sel;
|
||||||
@@ -517,6 +608,7 @@ public class FlatTestFrame
|
|||||||
buttonBar = new JPanel();
|
buttonBar = new JPanel();
|
||||||
lookAndFeelComboBox = new LookAndFeelsComboBox();
|
lookAndFeelComboBox = new LookAndFeelsComboBox();
|
||||||
scaleFactorComboBox = new JComboBox<>();
|
scaleFactorComboBox = new JComboBox<>();
|
||||||
|
fontSizeSpinner = new JSpinner();
|
||||||
rightToLeftCheckBox = new JCheckBox();
|
rightToLeftCheckBox = new JCheckBox();
|
||||||
enabledCheckBox = new JCheckBox();
|
enabledCheckBox = new JCheckBox();
|
||||||
inspectCheckBox = new JCheckBox();
|
inspectCheckBox = new JCheckBox();
|
||||||
@@ -562,6 +654,7 @@ public class FlatTestFrame
|
|||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
|
"[fill]" +
|
||||||
"[grow,fill]" +
|
"[grow,fill]" +
|
||||||
"[button,fill]",
|
"[button,fill]",
|
||||||
// rows
|
// rows
|
||||||
@@ -590,42 +683,48 @@ public class FlatTestFrame
|
|||||||
scaleFactorComboBox.addActionListener(e -> scaleFactorChanged());
|
scaleFactorComboBox.addActionListener(e -> scaleFactorChanged());
|
||||||
buttonBar.add(scaleFactorComboBox, "cell 1 0");
|
buttonBar.add(scaleFactorComboBox, "cell 1 0");
|
||||||
|
|
||||||
|
//---- fontSizeSpinner ----
|
||||||
|
fontSizeSpinner.putClientProperty("JComponent.minimumWidth", 50);
|
||||||
|
fontSizeSpinner.setModel(new SpinnerNumberModel(0, 0, null, 1));
|
||||||
|
fontSizeSpinner.addChangeListener(e -> fontSizeChanged());
|
||||||
|
buttonBar.add(fontSizeSpinner, "cell 2 0");
|
||||||
|
|
||||||
//---- rightToLeftCheckBox ----
|
//---- rightToLeftCheckBox ----
|
||||||
rightToLeftCheckBox.setText("right-to-left");
|
rightToLeftCheckBox.setText("right-to-left");
|
||||||
rightToLeftCheckBox.setMnemonic('R');
|
rightToLeftCheckBox.setMnemonic('R');
|
||||||
rightToLeftCheckBox.addActionListener(e -> rightToLeftChanged());
|
rightToLeftCheckBox.addActionListener(e -> rightToLeftChanged());
|
||||||
buttonBar.add(rightToLeftCheckBox, "cell 2 0");
|
buttonBar.add(rightToLeftCheckBox, "cell 3 0");
|
||||||
|
|
||||||
//---- enabledCheckBox ----
|
//---- enabledCheckBox ----
|
||||||
enabledCheckBox.setText("enabled");
|
enabledCheckBox.setText("enabled");
|
||||||
enabledCheckBox.setMnemonic('E');
|
enabledCheckBox.setMnemonic('E');
|
||||||
enabledCheckBox.setSelected(true);
|
enabledCheckBox.setSelected(true);
|
||||||
enabledCheckBox.addActionListener(e -> enabledChanged());
|
enabledCheckBox.addActionListener(e -> enabledChanged());
|
||||||
buttonBar.add(enabledCheckBox, "cell 3 0");
|
buttonBar.add(enabledCheckBox, "cell 4 0");
|
||||||
|
|
||||||
//---- inspectCheckBox ----
|
//---- inspectCheckBox ----
|
||||||
inspectCheckBox.setText("inspect");
|
inspectCheckBox.setText("inspect");
|
||||||
inspectCheckBox.setMnemonic('I');
|
inspectCheckBox.setMnemonic('I');
|
||||||
inspectCheckBox.addActionListener(e -> inspectChanged());
|
inspectCheckBox.addActionListener(e -> inspectChanged());
|
||||||
buttonBar.add(inspectCheckBox, "cell 4 0");
|
buttonBar.add(inspectCheckBox, "cell 5 0");
|
||||||
|
|
||||||
//---- explicitColorsCheckBox ----
|
//---- explicitColorsCheckBox ----
|
||||||
explicitColorsCheckBox.setText("explicit colors");
|
explicitColorsCheckBox.setText("explicit colors");
|
||||||
explicitColorsCheckBox.setMnemonic('X');
|
explicitColorsCheckBox.setMnemonic('X');
|
||||||
explicitColorsCheckBox.addActionListener(e -> explicitColorsChanged());
|
explicitColorsCheckBox.addActionListener(e -> explicitColorsChanged());
|
||||||
buttonBar.add(explicitColorsCheckBox, "cell 5 0");
|
buttonBar.add(explicitColorsCheckBox, "cell 6 0");
|
||||||
|
|
||||||
//---- backgroundCheckBox ----
|
//---- backgroundCheckBox ----
|
||||||
backgroundCheckBox.setText("background");
|
backgroundCheckBox.setText("background");
|
||||||
backgroundCheckBox.setMnemonic('B');
|
backgroundCheckBox.setMnemonic('B');
|
||||||
backgroundCheckBox.addActionListener(e -> backgroundChanged());
|
backgroundCheckBox.addActionListener(e -> backgroundChanged());
|
||||||
buttonBar.add(backgroundCheckBox, "cell 6 0");
|
buttonBar.add(backgroundCheckBox, "cell 7 0");
|
||||||
|
|
||||||
//---- opaqueTriStateCheckBox ----
|
//---- opaqueTriStateCheckBox ----
|
||||||
opaqueTriStateCheckBox.setText("opaque");
|
opaqueTriStateCheckBox.setText("opaque");
|
||||||
opaqueTriStateCheckBox.setMnemonic('O');
|
opaqueTriStateCheckBox.setMnemonic('O');
|
||||||
opaqueTriStateCheckBox.addActionListener(e -> opaqueChanged());
|
opaqueTriStateCheckBox.addActionListener(e -> opaqueChanged());
|
||||||
buttonBar.add(opaqueTriStateCheckBox, "cell 7 0");
|
buttonBar.add(opaqueTriStateCheckBox, "cell 8 0");
|
||||||
|
|
||||||
//---- sizeVariantComboBox ----
|
//---- sizeVariantComboBox ----
|
||||||
sizeVariantComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
|
sizeVariantComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
|
||||||
@@ -636,11 +735,11 @@ public class FlatTestFrame
|
|||||||
}));
|
}));
|
||||||
sizeVariantComboBox.setSelectedIndex(2);
|
sizeVariantComboBox.setSelectedIndex(2);
|
||||||
sizeVariantComboBox.addActionListener(e -> sizeVariantChanged());
|
sizeVariantComboBox.addActionListener(e -> sizeVariantChanged());
|
||||||
buttonBar.add(sizeVariantComboBox, "cell 8 0");
|
buttonBar.add(sizeVariantComboBox, "cell 9 0");
|
||||||
|
|
||||||
//---- closeButton ----
|
//---- closeButton ----
|
||||||
closeButton.setText("Close");
|
closeButton.setText("Close");
|
||||||
buttonBar.add(closeButton, "cell 10 0");
|
buttonBar.add(closeButton, "cell 11 0");
|
||||||
}
|
}
|
||||||
dialogPane.add(buttonBar, BorderLayout.SOUTH);
|
dialogPane.add(buttonBar, BorderLayout.SOUTH);
|
||||||
dialogPane.add(themesPanel, BorderLayout.EAST);
|
dialogPane.add(themesPanel, BorderLayout.EAST);
|
||||||
@@ -655,6 +754,7 @@ public class FlatTestFrame
|
|||||||
private JPanel buttonBar;
|
private JPanel buttonBar;
|
||||||
private LookAndFeelsComboBox lookAndFeelComboBox;
|
private LookAndFeelsComboBox lookAndFeelComboBox;
|
||||||
private JComboBox<String> scaleFactorComboBox;
|
private JComboBox<String> scaleFactorComboBox;
|
||||||
|
private JSpinner fontSizeSpinner;
|
||||||
private JCheckBox rightToLeftCheckBox;
|
private JCheckBox rightToLeftCheckBox;
|
||||||
private JCheckBox enabledCheckBox;
|
private JCheckBox enabledCheckBox;
|
||||||
private JCheckBox inspectCheckBox;
|
private JCheckBox inspectCheckBox;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets dialog"
|
"$layoutConstraints": "insets dialog"
|
||||||
"$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]"
|
"$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]"
|
||||||
"$rowSpecs": "[fill]"
|
"$rowSpecs": "[fill]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "buttonBar"
|
name: "buttonBar"
|
||||||
@@ -56,13 +56,23 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 0"
|
"value": "cell 1 0"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JSpinner" ) {
|
||||||
|
name: "fontSizeSpinner"
|
||||||
|
"$client.JComponent.minimumWidth": 50
|
||||||
|
"model": new javax.swing.SpinnerNumberModel {
|
||||||
|
minimum: 0
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "fontSizeChanged", false ) )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 0"
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "rightToLeftCheckBox"
|
name: "rightToLeftCheckBox"
|
||||||
"text": "right-to-left"
|
"text": "right-to-left"
|
||||||
"mnemonic": 82
|
"mnemonic": 82
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightToLeftChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "rightToLeftChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0"
|
"value": "cell 3 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "enabledCheckBox"
|
name: "enabledCheckBox"
|
||||||
@@ -71,7 +81,7 @@ new FormModel {
|
|||||||
"selected": true
|
"selected": true
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "enabledChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "enabledChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 0"
|
"value": "cell 4 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "inspectCheckBox"
|
name: "inspectCheckBox"
|
||||||
@@ -79,7 +89,7 @@ new FormModel {
|
|||||||
"mnemonic": 73
|
"mnemonic": 73
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "inspectChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "inspectChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 0"
|
"value": "cell 5 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "explicitColorsCheckBox"
|
name: "explicitColorsCheckBox"
|
||||||
@@ -87,7 +97,7 @@ new FormModel {
|
|||||||
"mnemonic": 88
|
"mnemonic": 88
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "explicitColorsChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "explicitColorsChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 5 0"
|
"value": "cell 6 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "backgroundCheckBox"
|
name: "backgroundCheckBox"
|
||||||
@@ -95,7 +105,7 @@ new FormModel {
|
|||||||
"mnemonic": 66
|
"mnemonic": 66
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "backgroundChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "backgroundChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 6 0"
|
"value": "cell 7 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) {
|
add( new FormComponent( "com.formdev.flatlaf.extras.TriStateCheckBox" ) {
|
||||||
name: "opaqueTriStateCheckBox"
|
name: "opaqueTriStateCheckBox"
|
||||||
@@ -103,7 +113,7 @@ new FormModel {
|
|||||||
"mnemonic": 79
|
"mnemonic": 79
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "opaqueChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "opaqueChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 7 0"
|
"value": "cell 8 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JComboBox" ) {
|
add( new FormComponent( "javax.swing.JComboBox" ) {
|
||||||
name: "sizeVariantComboBox"
|
name: "sizeVariantComboBox"
|
||||||
@@ -117,13 +127,13 @@ new FormModel {
|
|||||||
"selectedIndex": 2
|
"selectedIndex": 2
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "sizeVariantChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "sizeVariantChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 8 0"
|
"value": "cell 9 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "closeButton"
|
name: "closeButton"
|
||||||
"text": "Close"
|
"text": "Close"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 10 0"
|
"value": "cell 11 0"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class java.lang.String ) {
|
}, new FormLayoutConstraints( class java.lang.String ) {
|
||||||
"value": "South"
|
"value": "South"
|
||||||
|
|||||||
Reference in New Issue
Block a user