Remove JButton padding in MigLayout

Posted by Indrek on Stack Overflow See other posts from Stack Overflow or by Indrek
Published on 2010-05-02T20:06:39Z Indexed on 2010/05/02 20:18 UTC
Read the original article Hit count: 389

Filed under:
|
|
|

I have a small "popup" like this:

Tiny button

But I don't want the padding around the button, I want it to be as small as it can be with the supplied text.

btn.setMargin(new Insets(1, 1, 1, 1));
panel.add(lbl, "wrap");
panel.add(btn);
frame.pack();
frame.setVisible(true);

At least this doesn't work... Can this be achieved on MigLayout or should I use some other layout manager for this frame.

© Stack Overflow or respective owner

Related posts about java

Related posts about jbutton