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.
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
posted
0
try using setResizable(false). This will disable resizing of your Frame. hope this suffices. ------------------
Daniel Searson
Ranch Hand
Joined: Dec 03, 2000
Posts: 83
posted
0
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
posted
0
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.