Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridBagLayout

 
Ken Sampson
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://madbean.com/anim/totallygridbag
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic