Two Laptop Bag
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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.<br /> <br />#:^P
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Control the minimum size of a JFrame
 
Similar Threads
JSplitPane
Which JScrollPane ?
JSplitPanes not resizing when JFrame maximized
Dynamically nested JSplitPanes
Displaying GIF/PNG image files in a Java Swing application