-
August 4th, 2012, 09:41 AM
#1
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
-
August 5th, 2012, 06:08 PM
#2
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.
-
August 20th, 2012, 06:31 AM
#3
Re: keeping the size of the buttons the same
You can try button.setMaximumSize() and button.setMinimumSize(), set same size for both.
-
August 20th, 2012, 04:58 PM
#4
Re: keeping the size of the buttons the same
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|