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

@@ -55,6 +55,7 @@ public class FlatComponentsTest
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
JButton button3 = new JButton();
JButton button12 = new JButton();
JButton button13 = new JButton();
JLabel toggleButtonLabel = new JLabel();
JToggleButton toggleButton1 = new JToggleButton();
JToggleButton toggleButton2 = new JToggleButton();
@@ -246,6 +247,10 @@ public class FlatComponentsTest
button12.setEnabled(false);
add(button12, "cell 4 1");
//---- button13 ----
button13.setIcon(UIManager.getIcon("Tree.closedIcon"));
add(button13, "cell 5 1");
//---- toggleButtonLabel ----
toggleButtonLabel.setText("JToggleButton:");
add(toggleButtonLabel, "cell 0 2");

View File

@@ -76,6 +76,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: "toggleButtonLabel"
"text": "JToggleButton:"