Java/Swing: low-profile button height?

后端 未结 3 1365
遇见更好的自我
遇见更好的自我 2020-11-27 23:30

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         


        
3条回答
  •  死守一世寂寞
    2020-11-27 23:39

    Maybe just play with the Border of the button:

    Insets insets = button.getInsets();
    insets.top = 0;
    insets.bottom = 0;
    button.setMargin( insets );
    

提交回复
热议问题