This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes GridBagLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GridBagLayout " Watch "GridBagLayout " New topic
Author

GridBagLayout

Ken Sampson
Ranch Hand

Joined: Sep 26, 2007
Posts: 45
Hello,

I am confused as to how to work on GridBagLayout. Below is the sample code that i have tried ..

GBC is a customised class which extends GridBagConstraints and is defined
as




On running the above code I find that button 5 is covered by button 4 and is not displayed at all. On investigating I find that if I remove mentioning gridwidth and gridheight then button 5 gets displayed.

Please help to understand how to get around this problem.


Ken Sampson
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
http://madbean.com/anim/totallygridbag


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ted Smyth
Ranch Hand

Joined: May 28, 2008
Posts: 73
Originally posted by Ilja Preuss:
http://madbean.com/anim/totallygridbag


Oh goodness that's golden...!

I haven't used GridBag in a long time, nor do I plan on it.

Not that I'm trying to give plugs to certain developers, but I really think MigLayout (miglayout.com) is a phenomenal LayoutManager, which really eclipses Gridbag in simplicity and flexibility.


Edward Smith
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
 
wood burning stoves
 
subject: GridBagLayout
 
Similar Threads
how to align components in GridBagLayout in JAVA swing
Layout problem
Swing
GridBagLayout
GUI - tile