diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java index 9c3c9ffe..c27a556b 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java @@ -54,6 +54,15 @@ public class FlatComponentsTest progressBar4.setIndeterminate( indeterminate ); } + private void contentAreaFilledChanged() { + boolean contentAreaFilled = contentAreaFilledCheckBox.isSelected(); + + for( Component c : getComponents() ) { + if( c instanceof AbstractButton ) + ((AbstractButton)c).setContentAreaFilled( contentAreaFilled ); + } + } + private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents JLabel labelLabel = new JLabel(); @@ -90,6 +99,7 @@ public class FlatComponentsTest JRadioButton radioButton2 = new JRadioButton(); JRadioButton radioButton3 = new JRadioButton(); JRadioButton radioButton4 = new JRadioButton(); + contentAreaFilledCheckBox = new JCheckBox(); JLabel comboBoxLabel = new JLabel(); JComboBox comboBox1 = new JComboBox<>(); JComboBox comboBox2 = new JComboBox<>(); @@ -408,6 +418,12 @@ public class FlatComponentsTest radioButton4.setEnabled(false); add(radioButton4, "cell 4 4"); + //---- contentAreaFilledCheckBox ---- + contentAreaFilledCheckBox.setText("contentAreaFilled"); + contentAreaFilledCheckBox.setSelected(true); + contentAreaFilledCheckBox.addActionListener(e -> contentAreaFilledChanged()); + add(contentAreaFilledCheckBox, "cell 5 4"); + //---- comboBoxLabel ---- comboBoxLabel.setText("JComboBox:"); add(comboBoxLabel, "cell 0 5"); @@ -974,6 +990,7 @@ public class FlatComponentsTest } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JCheckBox contentAreaFilledCheckBox; private JProgressBar progressBar3; private JProgressBar progressBar4; private JSlider slider3; diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd index 48ccc963..07d7784f 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd @@ -258,6 +258,17 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 4 4" } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "contentAreaFilledCheckBox" + "text": "contentAreaFilled" + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "contentAreaFilledChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 5 4" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "comboBoxLabel" "text": "JComboBox:"