Button: make icon-only buttons square (no minimum width, smaller left/right insets)

This commit is contained in:
Karl Tauber
2019-10-04 18:13:41 +02:00
parent 26a2446a4d
commit 37c70f6c9e
7 changed files with 50 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ class BasicComponentsPanel
JButton button2 = new JButton();
JButton button3 = new JButton();
JButton button4 = new JButton();
JButton button13 = new JButton();
JLabel checkBoxLabel = new JLabel();
JCheckBox checkBox1 = new JCheckBox();
JCheckBox checkBox2 = new JCheckBox();
@@ -169,6 +170,10 @@ class BasicComponentsPanel
button4.setEnabled(false);
add(button4, "cell 4 1");
//---- button13 ----
button13.setIcon(UIManager.getIcon("Tree.closedIcon"));
add(button13, "cell 5 1");
//---- checkBoxLabel ----
checkBoxLabel.setText("JCheckBox");
add(checkBoxLabel, "cell 0 2");

View File

@@ -69,6 +69,12 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 1"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button13"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "checkBoxLabel"
"text": "JCheckBox"