mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
Button and ToggleButton: support square button style
This commit is contained in:
@@ -61,7 +61,9 @@ public class FlatComponentsTest
|
||||
JLabel label2 = new JLabel();
|
||||
JLabel buttonLabel = new JLabel();
|
||||
JButton button1 = new JButton();
|
||||
JButton button17 = new JButton();
|
||||
JButton button2 = new JButton();
|
||||
JButton button18 = new JButton();
|
||||
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
|
||||
JButton button3 = new JButton();
|
||||
JButton button12 = new JButton();
|
||||
@@ -71,7 +73,9 @@ public class FlatComponentsTest
|
||||
JButton button16 = new JButton();
|
||||
JLabel toggleButtonLabel = new JLabel();
|
||||
JToggleButton toggleButton1 = new JToggleButton();
|
||||
JToggleButton toggleButton9 = new JToggleButton();
|
||||
JToggleButton toggleButton2 = new JToggleButton();
|
||||
JToggleButton toggleButton10 = new JToggleButton();
|
||||
JToggleButton toggleButton3 = new JToggleButton();
|
||||
JToggleButton toggleButton4 = new JToggleButton();
|
||||
JLabel checkBoxLabel = new JLabel();
|
||||
@@ -249,6 +253,11 @@ public class FlatComponentsTest
|
||||
button1.setToolTipText("This button is enabled.");
|
||||
add(button1, "cell 1 1");
|
||||
|
||||
//---- button17 ----
|
||||
button17.setText("square");
|
||||
button17.putClientProperty("JButton.buttonType", "square");
|
||||
add(button17, "cell 1 1");
|
||||
|
||||
//---- button2 ----
|
||||
button2.setText("disabled");
|
||||
button2.setDisplayedMnemonicIndex(0);
|
||||
@@ -256,6 +265,12 @@ public class FlatComponentsTest
|
||||
button2.setToolTipText("This button is disabled.");
|
||||
add(button2, "cell 2 1");
|
||||
|
||||
//---- button18 ----
|
||||
button18.setText("square");
|
||||
button18.putClientProperty("JButton.buttonType", "square");
|
||||
button18.setEnabled(false);
|
||||
add(button18, "cell 2 1");
|
||||
|
||||
//---- button5 ----
|
||||
button5.setText("default");
|
||||
button5.setDisplayedMnemonicIndex(0);
|
||||
@@ -297,11 +312,22 @@ public class FlatComponentsTest
|
||||
toggleButton1.setText("enabled");
|
||||
add(toggleButton1, "cell 1 2");
|
||||
|
||||
//---- toggleButton9 ----
|
||||
toggleButton9.setText("square");
|
||||
toggleButton9.putClientProperty("JButton.buttonType", "square");
|
||||
add(toggleButton9, "cell 1 2");
|
||||
|
||||
//---- toggleButton2 ----
|
||||
toggleButton2.setText("disabled");
|
||||
toggleButton2.setEnabled(false);
|
||||
add(toggleButton2, "cell 2 2");
|
||||
|
||||
//---- toggleButton10 ----
|
||||
toggleButton10.setText("square");
|
||||
toggleButton10.putClientProperty("JButton.buttonType", "square");
|
||||
toggleButton10.setEnabled(false);
|
||||
add(toggleButton10, "cell 2 2");
|
||||
|
||||
//---- toggleButton3 ----
|
||||
toggleButton3.setText("selected");
|
||||
toggleButton3.setSelected(true);
|
||||
|
||||
@@ -47,6 +47,13 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button17"
|
||||
"text": "square"
|
||||
"$client.JButton.buttonType": "square"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button2"
|
||||
"text": "disabled"
|
||||
@@ -56,6 +63,14 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button18"
|
||||
"text": "square"
|
||||
"$client.JButton.buttonType": "square"
|
||||
"enabled": false
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
} )
|
||||
add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestDefaultButton" ) {
|
||||
name: "button5"
|
||||
"text": "default"
|
||||
@@ -115,6 +130,13 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton9"
|
||||
"text": "square"
|
||||
"$client.JButton.buttonType": "square"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton2"
|
||||
"text": "disabled"
|
||||
@@ -122,6 +144,14 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton10"
|
||||
"text": "square"
|
||||
"$client.JButton.buttonType": "square"
|
||||
"enabled": false
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "toggleButton3"
|
||||
"text": "selected"
|
||||
@@ -935,7 +965,7 @@ new FormModel {
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 865, 800 )
|
||||
"size": new java.awt.Dimension( 1005, 800 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user