aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Control the minimum size of a JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Control the minimum size of a JFrame" Watch "Control the minimum size of a JFrame" New topic
Author

Control the minimum size of a JFrame

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
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


Rob
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Control the minimum size of a JFrame