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

Control the minimum size of a JFrame

 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about posting what's probably a trivial question to you SWING Gurus, but ...
I have a resizable JFrame as the outermost container of my SWING application. How can I restrict the minimum size to which it can be set?
While I'm here, some slightly harder, related questions: -
Can this be automatically calculated from the minimum sizes of the contents - in this case a split pane containing another split pane (containing a scrollable tree and a scrollable table) and a desktop pane?
How can I best ensure that split panes maintain sensible positions as the container which holds them is resized?
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Chase:
Sorry about posting what's probably a trivial question to you SWING Gurus, but ...
I have a resizable JFrame as the outermost container of my SWING application. How can I restrict the minimum size to which it can be set?
While I'm here, some slightly harder, related questions: -
Can this be automatically calculated from the minimum sizes of the contents - in this case a split pane containing another split pane (containing a scrollable tree and a scrollable table) and a desktop pane?
How can I best ensure that split panes maintain sensible positions as the container which holds them is resized?


Sadly, you cannot restrict the size of a JFrame. It's a native peer, so it's being drawn by the native OS, and java doesn't provide you an API to access this kind of functionality. Maybe in a future version.

Rob
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic