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);
edit: I'm using JavaBuilders + MigLayout. It looks like I have to do button.setMaxSize(d);
instead of setPreferredSize(), not sure why.