Why will BoxLayout not allow me to change the width of a JButton but let me change the height?

前端 未结 6 1833
别那么骄傲
别那么骄傲 2020-12-31 01:49

I\'m trying to get the Layout of a JDialog of mine to fit a particular look that a program in which I\'m porting to Java has, I\'ve used several LayoutManagers

6条回答
  •  Happy的楠姐
    2020-12-31 02:39

    Usually if want to ensure a size of the component in Swing you need to call setMinimumSize(), setMaximumSize(), and SetPrefferedSize() with the same value.

提交回复
热议问题