Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting frame minimum size

 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the code to do that, implemented as an anonymous inner class:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic