mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
FlatComponentsTest: add checkbox to change contentAreaFilled of all buttons (for issue #58)
This commit is contained in:
@@ -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<String> comboBox1 = new JComboBox<>();
|
||||
JComboBox<String> 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;
|
||||
|
||||
@@ -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:"
|
||||
|
||||
Reference in New Issue
Block a user