aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes 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 "JFrame" Watch "JFrame" New topic
Author

JFrame

raja syamala
Greenhorn

Joined: Aug 15, 2001
Posts: 2
Hi,
I have a class that extends JFrame and JPanel, JTabbedPane, JButtons etc.. are added to it. I am using
classname.setSize(500,500).
But when I maximize the window manually or resize the window the size of the contents in the frame are changing. Is there a way to set the size of the frame and its components to be constant all the time. I tried to use the same method on the components as well. But the problem still persists.
Tried using pack(). But didn't work the way I want it.
Please let me know if there is any way to set the fixed size.
Thanks in advance.
G Gordan
Greenhorn

Joined: Aug 16, 2001
Posts: 1
you just set layout of content panel to null.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

If you follow the above hint, be sure to set the location and size of all your components using setBounds( x, y, w, h )...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
K Venugopal
Greenhorn

Joined: Aug 07, 2001
Posts: 2
try using setResizable(false). This will disable resizing of your Frame.
hope this suffices.
------------------
Daniel Searson
Ranch Hand

Joined: Dec 03, 2000
Posts: 83
I'd also reccommend using setResizable(false) as using no layout manager can get messy.
-Daniel


- Daniel
jaganbala
Greenhorn

Joined: Aug 21, 2001
Posts: 2
U will have to use GridBagLayout and set the fill factor for all the components as None.Then the components will retain its original size even if the screen was maximised.
 
wood burning stoves
 
subject: JFrame