Java/Swing: low-profile button height?

Posted by Jason S on Stack Overflow See other posts from Stack Overflow or by Jason S
Published on 2010-05-24T20:06:37Z Indexed on 2010/05/24 20:41 UTC
Read the original article Hit count: 200

Filed under:
|
|

I would like to reduce the vertical size of a JButton. The following code works fine for K > 1 but I can't seem to reduce the size. Any suggestions?

JButton button = /* ... get button here ... */
Dimension d = button.getPreferredSize();
d.setSize(d.getWidth(), d.getHeight()*K);
button.setPreferredSize(d);

© Stack Overflow or respective owner

Related posts about java

Related posts about swing