• Post Reply Bookmark Topic Watch Topic
  • New Topic

GridbagLayout  RSS feed

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ranchers,
i need help. i am trying to figure out how to use gridbaglayout. it is very hard to place the components. so what i want to know is, whether there is an easy way to layout the components any where we want. i mean i want to get a very good interface. thanks
 
Gary McGath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think anyone has ever really understood GridBagLayout. It's a crock. Generally I get better control over how things are laid out by starting with a top-level pane with a GridLayout, BorderLayout, or (in Swing) BoxLayout and then grouping components in nested Containers.
 
basha khan
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ransinka,
Gridbaglayout is conceptually not difficult.what u wanna do is just put values on Gridbagconstraint's fields.it'll be easy when u start.
The actual problom comes when laying out other panels on(if u have any) on it.The stretching strategy is too strange.
i 've tried to uncover GridBagLayout's problom.but it'll take a little time and effort. now i m too busy with other issues so i put it to some anither time.
i agrees with McGrath
I don't think anyone has ever really understood GridBagLayout. It's a crock.

u can use gridlayout.I had a similer problom as ur's.i have successfully replaced with gridlayout.
best of luck
basha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!