mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 15:27:16 -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 );
|
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() {
|
private void initComponents() {
|
||||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||||
JLabel labelLabel = new JLabel();
|
JLabel labelLabel = new JLabel();
|
||||||
@@ -90,6 +99,7 @@ public class FlatComponentsTest
|
|||||||
JRadioButton radioButton2 = new JRadioButton();
|
JRadioButton radioButton2 = new JRadioButton();
|
||||||
JRadioButton radioButton3 = new JRadioButton();
|
JRadioButton radioButton3 = new JRadioButton();
|
||||||
JRadioButton radioButton4 = new JRadioButton();
|
JRadioButton radioButton4 = new JRadioButton();
|
||||||
|
contentAreaFilledCheckBox = new JCheckBox();
|
||||||
JLabel comboBoxLabel = new JLabel();
|
JLabel comboBoxLabel = new JLabel();
|
||||||
JComboBox<String> comboBox1 = new JComboBox<>();
|
JComboBox<String> comboBox1 = new JComboBox<>();
|
||||||
JComboBox<String> comboBox2 = new JComboBox<>();
|
JComboBox<String> comboBox2 = new JComboBox<>();
|
||||||
@@ -408,6 +418,12 @@ public class FlatComponentsTest
|
|||||||
radioButton4.setEnabled(false);
|
radioButton4.setEnabled(false);
|
||||||
add(radioButton4, "cell 4 4");
|
add(radioButton4, "cell 4 4");
|
||||||
|
|
||||||
|
//---- contentAreaFilledCheckBox ----
|
||||||
|
contentAreaFilledCheckBox.setText("contentAreaFilled");
|
||||||
|
contentAreaFilledCheckBox.setSelected(true);
|
||||||
|
contentAreaFilledCheckBox.addActionListener(e -> contentAreaFilledChanged());
|
||||||
|
add(contentAreaFilledCheckBox, "cell 5 4");
|
||||||
|
|
||||||
//---- comboBoxLabel ----
|
//---- comboBoxLabel ----
|
||||||
comboBoxLabel.setText("JComboBox:");
|
comboBoxLabel.setText("JComboBox:");
|
||||||
add(comboBoxLabel, "cell 0 5");
|
add(comboBoxLabel, "cell 0 5");
|
||||||
@@ -974,6 +990,7 @@ public class FlatComponentsTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||||
|
private JCheckBox contentAreaFilledCheckBox;
|
||||||
private JProgressBar progressBar3;
|
private JProgressBar progressBar3;
|
||||||
private JProgressBar progressBar4;
|
private JProgressBar progressBar4;
|
||||||
private JSlider slider3;
|
private JSlider slider3;
|
||||||
|
|||||||
@@ -258,6 +258,17 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 4"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "comboBoxLabel"
|
name: "comboBoxLabel"
|
||||||
"text": "JComboBox:"
|
"text": "JComboBox:"
|
||||||
|
|||||||
Reference in New Issue
Block a user