| Author |
Setting frame minimum size
|
Anna Hays
Ranch Hand
Joined: Nov 09, 2003
Posts: 131
|
|
Hi, I am trying to make the frame to have a minimum size so that it won't resize to one pixel. There are 2 ways I can think of to do this. 1. make the frame to have a minimum size. 2. make all main (in the content pane) components to have a minimum size so that if I add another one, the minimised frame will still show all components. Since I can't find frame can set a minimum size, so 2 is the way to go. And I think 2 is better way as well, am I right? Should the frame have a minimum size too? Thanks for any advice.
|
 |
Anna Hays
Ranch Hand
Joined: Nov 09, 2003
Posts: 131
|
|
|
Hi again, just realise 2 won't work. I have give the components a minimum size, but the frame can still resize pass the minimum size. Can someone help me please?
|
 |
Anton Golovin
Ranch Hand
Joined: Jul 02, 2004
Posts: 473
|
|
Hi, Anna. I think this may be a good solution. The componentResized event handler could set the minimum size. ... the Adapter: Hope this info is what you are looking for I hope the mechanism will be helpful to your project. Sincerely, Anton. [ October 16, 2004: Message edited by: Anton Golovin ] [ October 16, 2004: Message edited by: Anton Golovin ]
|
Anton Golovin<br /><i>anton.golovin@gmail.com</i><br />SCJP, SCJD, SCBCD, SCWCD
|
 |
peter wooster
Ranch Hand
Joined: Jun 13, 2004
Posts: 1033
|
|
Here's the code to do that, implemented as an anonymous inner class:
|
 |
 |
|
|
subject: Setting frame minimum size
|
|
|