This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes GridBagLayout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GridBagLayout problem" Watch "GridBagLayout problem" New topic

GridBagLayout problem

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i'm trying to build the following:

lbl1 txt1 bt1 bt2 bt3 bt4
lbl2 txt2 bt5 bt6

but when i try to add button bt5 it allways goes right to bt4 right side!

here's my code:

i tried several constraints variations but with no result

How can i solve this?


java amateur
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
panel.add(new JButton("Actualizar"));
panel.add(new JButton("Actualizar"),c);//add the constraint
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
of course!

I agree. Here's the link:
subject: GridBagLayout problem
It's not a secret anymore!