Button and ToggleButton: support square button style

This commit is contained in:
Karl Tauber
2020-01-08 13:57:42 +01:00
parent 8e84112837
commit af7c181596
10 changed files with 116 additions and 13 deletions

View File

@@ -37,6 +37,8 @@ class BasicComponentsPanel
JLabel buttonLabel = new JLabel();
JButton button1 = new JButton();
JButton button2 = new JButton();
JButton button5 = new JButton();
JButton button6 = new JButton();
JButton button3 = new JButton();
JButton button4 = new JButton();
JButton button13 = new JButton();
@@ -166,10 +168,21 @@ class BasicComponentsPanel
button2.setEnabled(false);
add(button2, "cell 2 1");
//---- button5 ----
button5.setText("square");
button5.putClientProperty("JButton.buttonType", "square");
add(button5, "cell 3 1");
//---- button6 ----
button6.setText("square");
button6.setEnabled(false);
button6.putClientProperty("JButton.buttonType", "square");
add(button6, "cell 4 1");
//---- button3 ----
button3.setText("Help");
button3.putClientProperty("JButton.buttonType", "help");
add(button3, "cell 3 1");
add(button3, "cell 4 1");
//---- button4 ----
button4.setText("Help");

View File

@@ -1,4 +1,4 @@
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8"
new FormModel {
contentType: "form/swing"
@@ -54,12 +54,27 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button5"
"text": "square"
"$client.JButton.buttonType": "square"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button6"
"text": "square"
"enabled": false
"$client.JButton.buttonType": "square"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button3"
"text": "Help"
"$client.JButton.buttonType": "help"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 1"
"value": "cell 4 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button4"