keeping the size of the buttons the same
hello guys
I was wondering if i want to keep the size of the buttons the same when resizing the program, how can i code that.
now when I resize the program the buttons become larger if I maximize the program the reverse is true, so how can I keep the buttons size the same?
thanks
Re: keeping the size of the buttons the same
The display size of the buttons depends on the Layout manager you are using. Some layout managers increase the size of components as the screen area grows others don't. FlowLayout for instance sizes the buttons at their preferred size.
Re: keeping the size of the buttons the same
You can try button.setMaximumSize() and button.setMinimumSize(), set same size for both.
Re: keeping the size of the buttons the same
Quote:
Originally Posted by nambill
You can try button.setMaximumSize() and button.setMinimumSize(), set same size for both.
This won't work for all LayoutManagers as some only look at the preferred size and not the min/max sizes.