GrigBagLayout Customizing Default Insets

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

GrigBagLayout Customizing Default Insets

Postby chrisR » Tue Jul 28, 2009 6:30 am

How do I customize the default Insets of Components for GridBagLayout?
This was a feature of a previous version.
I can't find the customization Dialog of Insets for GridBagLayout.

Kind regards
chrisR
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: GrigBagLayout Customizing Default Insets

Postby Konstantin.Scheglov » Fri Jul 31, 2009 1:59 am

Why do you want this?
In new version we automatically manage GridBagLayout insets to produce gaps between columns and rows.
So, use GBL just as normal grid and don't care about insets.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: GrigBagLayout Customizing Default Insets

Postby chrisR » Mon Aug 03, 2009 5:27 am

Nice feature :)
Thus the default gap between columns and row is 5. :?
How do I change the default gap to 2,3 or 6 or... :?:
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: GrigBagLayout Customizing Default Insets

Postby Eric Clayberg » Tue Aug 04, 2009 10:51 am

Give this a try using the latest Swing Designer v7.1 build.

gbl-prefs.png
gbl-prefs.png (29.5 KiB) Viewed 565 times
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: GrigBagLayout Customizing Default Insets

Postby chrisR » Wed Aug 05, 2009 4:00 am

Thanks,

it works.
Now, I can customize the gap between columns and rows. :)

However, a single Component on a Container with GBL has zero insets (for top, left, bottom, right) :?
It is nice to have this gap between a column and the border of the container automatically. (row and border respectively) :wink:

Kind Regards
Chris
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: GrigBagLayout Customizing Default Insets

Postby Eric Clayberg » Wed Aug 05, 2009 4:44 am

Whether a container should have a border inset seems best left to the user on a case-by-case basis. I can think of lots of cases where I would not want a border inset like that.

The better way to establish margin borders around a container when using any layout manager is just to assign an EmptyBorder to the container with whatever insets you wish.

Image Image
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: GrigBagLayout Customizing Default Insets

Postby chrisR » Wed Aug 05, 2009 8:00 am

O.K. this will do.
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: GrigBagLayout Customizing Default Insets

Postby Eric Clayberg » Thu Aug 06, 2009 6:10 am

Glad that works for you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest