• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gridbaglayout problom

 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anybody have any idea??.it's urgent.
basha
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try setPreferredSize( Dimension )... FlowLayout honours each component's preferred size.
 
basha khan
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic