Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Gridbaglayout problom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Gridbaglayout problom" Watch "Gridbaglayout problom" New topic
Author

Gridbaglayout problom

basha khan
Ranch Hand

Joined: Jan 18, 2002
Posts: 87
hi ranchers,
i needs a frame with 5 panels.
i m using GridBagLayout as layout manager for my frame
One of my panel uses GridLayout.
One of my panel uses GridBagLayout.
Rest of the panels does'nt need any layuot(default,Flowlayout).
First i added 5 empty panels for correcting the location of each panel.i made a nice skeleton for adding the panels(positioning is over)
then i replaced temporary panels with 'original' panels.but when i add the panel which uses GridLayout,the propotion of frame changed undesirably.The same problom occured when i tried to add my gridbaglayout panel.
do i need to specify setSize() for each panel?.
basha
basha khan
Ranch Hand

Joined: Jan 18, 2002
Posts: 87
anybody have any idea??.it's urgent.
basha
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Try setPreferredSize( Dimension )... FlowLayout honours each component's preferred size.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
basha khan
Ranch Hand

Joined: Jan 18, 2002
Posts: 87
Hi nate,
but i wanna stretch some componets.
Even though i 've tried in all the way. even i tried with setSize() on each component.
I just dont getting the problom.i read all the topics /tutorials availeable on this issue.none of them pointing to the real problom.
There is something unknown in GridBagLayout.The stretching strategy of this layout is not straightforward as documentation says.Dont getting answer from any tutorials/topics.
Either i 've to find the solution or the real problom.
basha
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Can you post your current code for the top level container? Maybe I can figure something out if I see what constraints you are using on your GridBagLayout...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Gridbaglayout problom
 
Similar Threads
Help sorting out what combination of layouts will provide the result I need
Window Size
help needed Swing
same old gridbag
Dynamic panel ...