Java/Swing: low-profile button height?
- by Jason S
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);