mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
FlatComponentsTest: removed "selected" JButtons and improved layout for sliders and progrssbars
This commit is contained in:
@@ -51,8 +51,6 @@ public class FlatComponentsTest
|
|||||||
JLabel buttonLabel = new JLabel();
|
JLabel buttonLabel = new JLabel();
|
||||||
JButton button1 = new JButton();
|
JButton button1 = new JButton();
|
||||||
JButton button2 = new JButton();
|
JButton button2 = new JButton();
|
||||||
JButton button3 = new JButton();
|
|
||||||
JButton button4 = new JButton();
|
|
||||||
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
|
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
|
||||||
JLabel checkBoxLabel = new JLabel();
|
JLabel checkBoxLabel = new JLabel();
|
||||||
JCheckBox checkBox1 = new JCheckBox();
|
JCheckBox checkBox1 = new JCheckBox();
|
||||||
@@ -204,21 +202,10 @@ public class FlatComponentsTest
|
|||||||
button2.setEnabled(false);
|
button2.setEnabled(false);
|
||||||
add(button2, "cell 2 1");
|
add(button2, "cell 2 1");
|
||||||
|
|
||||||
//---- button3 ----
|
|
||||||
button3.setText("selected");
|
|
||||||
button3.setSelected(true);
|
|
||||||
add(button3, "cell 3 1");
|
|
||||||
|
|
||||||
//---- button4 ----
|
|
||||||
button4.setText("selected disabled");
|
|
||||||
button4.setSelected(true);
|
|
||||||
button4.setEnabled(false);
|
|
||||||
add(button4, "cell 4 1");
|
|
||||||
|
|
||||||
//---- button5 ----
|
//---- button5 ----
|
||||||
button5.setText("default");
|
button5.setText("default");
|
||||||
button5.setDisplayedMnemonicIndex(0);
|
button5.setDisplayedMnemonicIndex(0);
|
||||||
add(button5, "cell 5 1");
|
add(button5, "cell 3 1");
|
||||||
|
|
||||||
//---- checkBoxLabel ----
|
//---- checkBoxLabel ----
|
||||||
checkBoxLabel.setText("JCheckBox");
|
checkBoxLabel.setText("JCheckBox");
|
||||||
@@ -226,7 +213,7 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//---- checkBox1 ----
|
//---- checkBox1 ----
|
||||||
checkBox1.setText("enabled");
|
checkBox1.setText("enabled");
|
||||||
checkBox1.setMnemonic('E');
|
checkBox1.setMnemonic('A');
|
||||||
add(checkBox1, "cell 1 2");
|
add(checkBox1, "cell 1 2");
|
||||||
|
|
||||||
//---- checkBox2 ----
|
//---- checkBox2 ----
|
||||||
@@ -615,13 +602,13 @@ public class FlatComponentsTest
|
|||||||
//---- progressBar3 ----
|
//---- progressBar3 ----
|
||||||
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar3.setValue(50);
|
progressBar3.setValue(50);
|
||||||
add(progressBar3, "cell 4 12 1 4");
|
add(progressBar3, "cell 4 12 1 4,growy");
|
||||||
|
|
||||||
//---- progressBar4 ----
|
//---- progressBar4 ----
|
||||||
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar4.setValue(55);
|
progressBar4.setValue(55);
|
||||||
progressBar4.setStringPainted(true);
|
progressBar4.setStringPainted(true);
|
||||||
add(progressBar4, "cell 4 12 1 4");
|
add(progressBar4, "cell 4 12 1 4,growy");
|
||||||
|
|
||||||
//---- scrollBarLabel ----
|
//---- scrollBarLabel ----
|
||||||
scrollBarLabel.setText("JScrollBar:");
|
scrollBarLabel.setText("JScrollBar:");
|
||||||
@@ -647,12 +634,12 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//---- slider1 ----
|
//---- slider1 ----
|
||||||
slider1.setValue(30);
|
slider1.setValue(30);
|
||||||
add(slider1, "cell 1 16,aligny top,grow 100 0");
|
add(slider1, "cell 1 16 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider6 ----
|
//---- slider6 ----
|
||||||
slider6.setEnabled(false);
|
slider6.setEnabled(false);
|
||||||
slider6.setValue(30);
|
slider6.setValue(30);
|
||||||
add(slider6, "cell 2 16,aligny top,grow 100 0");
|
add(slider6, "cell 1 16 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- slider3 ----
|
//---- slider3 ----
|
||||||
slider3.setMinorTickSpacing(10);
|
slider3.setMinorTickSpacing(10);
|
||||||
@@ -660,7 +647,7 @@ public class FlatComponentsTest
|
|||||||
slider3.setMajorTickSpacing(50);
|
slider3.setMajorTickSpacing(50);
|
||||||
slider3.setPaintLabels(true);
|
slider3.setPaintLabels(true);
|
||||||
slider3.setValue(30);
|
slider3.setValue(30);
|
||||||
add(slider3, "cell 1 17,aligny top,grow 100 0");
|
add(slider3, "cell 1 17 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider5 ----
|
//---- slider5 ----
|
||||||
slider5.setMinorTickSpacing(10);
|
slider5.setMinorTickSpacing(10);
|
||||||
@@ -669,7 +656,7 @@ public class FlatComponentsTest
|
|||||||
slider5.setPaintLabels(true);
|
slider5.setPaintLabels(true);
|
||||||
slider5.setEnabled(false);
|
slider5.setEnabled(false);
|
||||||
slider5.setValue(30);
|
slider5.setValue(30);
|
||||||
add(slider5, "cell 2 17,aligny top,grow 100 0");
|
add(slider5, "cell 1 17 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- progressBarLabel ----
|
//---- progressBarLabel ----
|
||||||
progressBarLabel.setText("JProgressBar:");
|
progressBarLabel.setText("JProgressBar:");
|
||||||
@@ -677,12 +664,12 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//---- progressBar1 ----
|
//---- progressBar1 ----
|
||||||
progressBar1.setValue(50);
|
progressBar1.setValue(50);
|
||||||
add(progressBar1, "cell 1 18");
|
add(progressBar1, "cell 1 18 3 1,growx");
|
||||||
|
|
||||||
//---- progressBar2 ----
|
//---- progressBar2 ----
|
||||||
progressBar2.setStringPainted(true);
|
progressBar2.setStringPainted(true);
|
||||||
progressBar2.setValue(55);
|
progressBar2.setValue(55);
|
||||||
add(progressBar2, "cell 3 18");
|
add(progressBar2, "cell 1 18 3 1,growx");
|
||||||
|
|
||||||
//---- indeterminateCheckBox ----
|
//---- indeterminateCheckBox ----
|
||||||
indeterminateCheckBox.setText("indeterminate");
|
indeterminateCheckBox.setText("indeterminate");
|
||||||
|
|||||||
@@ -54,27 +54,12 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 1"
|
"value": "cell 2 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
|
||||||
name: "button3"
|
|
||||||
"text": "selected"
|
|
||||||
"selected": true
|
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
|
||||||
"value": "cell 3 1"
|
|
||||||
} )
|
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
|
||||||
name: "button4"
|
|
||||||
"text": "selected disabled"
|
|
||||||
"selected": true
|
|
||||||
"enabled": false
|
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
|
||||||
"value": "cell 4 1"
|
|
||||||
} )
|
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatComponentsTest$TestDefaultButton" ) {
|
add( new FormComponent( "com.formdev.flatlaf.FlatComponentsTest$TestDefaultButton" ) {
|
||||||
name: "button5"
|
name: "button5"
|
||||||
"text": "default"
|
"text": "default"
|
||||||
"displayedMnemonicIndex": 0
|
"displayedMnemonicIndex": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 5 1"
|
"value": "cell 3 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "checkBoxLabel"
|
name: "checkBoxLabel"
|
||||||
@@ -85,7 +70,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "checkBox1"
|
name: "checkBox1"
|
||||||
"text": "enabled"
|
"text": "enabled"
|
||||||
"mnemonic": 69
|
"mnemonic": 65
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 2"
|
"value": "cell 1 2"
|
||||||
} )
|
} )
|
||||||
@@ -575,7 +560,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 12 1 4"
|
"value": "cell 4 12 1 4,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar4"
|
name: "progressBar4"
|
||||||
@@ -586,7 +571,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 12 1 4"
|
"value": "cell 4 12 1 4,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "scrollBarLabel"
|
name: "scrollBarLabel"
|
||||||
@@ -628,14 +613,14 @@ new FormModel {
|
|||||||
name: "slider1"
|
name: "slider1"
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 16,aligny top,grow 100 0"
|
"value": "cell 1 16 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider6"
|
name: "slider6"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 16,aligny top,grow 100 0"
|
"value": "cell 1 16 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider3"
|
name: "slider3"
|
||||||
@@ -645,7 +630,7 @@ new FormModel {
|
|||||||
"paintLabels": true
|
"paintLabels": true
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 17,aligny top,grow 100 0"
|
"value": "cell 1 17 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider5"
|
name: "slider5"
|
||||||
@@ -656,7 +641,7 @@ new FormModel {
|
|||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 17,aligny top,grow 100 0"
|
"value": "cell 1 17 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "progressBarLabel"
|
name: "progressBarLabel"
|
||||||
@@ -671,7 +656,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 18"
|
"value": "cell 1 18 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar2"
|
name: "progressBar2"
|
||||||
@@ -681,7 +666,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 18"
|
"value": "cell 1 18 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "indeterminateCheckBox"
|
name: "indeterminateCheckBox"
|
||||||
|
|||||||
Reference in New Issue
Block a user