GridBagLayout Deletion of Component does not correct columns

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

GridBagLayout Deletion of Component does not correct columns

Postby chrisR » Mon Jul 27, 2009 6:34 am

When I create a new JPanel and set the GridbagLayoutManager I start with:
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0};
gridBagLayout.rowHeights = new int[]{0};
gridBagLayout.columnWeights = new double[]{1.0E-4};
gridBagLayout.rowWeights = new double[]{1.0E-4};
setLayout(gridBagLayout);

one row and one column with a dummy width!
In the following I focus on the columns.
I add one JPanel and obtain:
gridBagLayout.columnWidths = new int[]{0, 0};
gridBagLayout.columnWeights = new double[]{1.0, 1.0E-4};

2 columns, one with a dummy weight.
I add a second JPanel resulting in another column:
gridBagLayout.columnWidths = new int[]{0, 0, 0};
gridBagLayout.columnWeights = new double[]{1.0, 1.0, 1.0E-4};

3 columns, one with the dummy weight.
1 Delete the second JPanel
gridBagLayout.columnWidths = new int[]{0, 0, 0};
gridBagLayout.columnWeights = new double[]{1.0, 1.0, 1.0E-4};

3 columns :(, one with the dummy weight.
I expected 2 columns :!:
How can I change the column count within the Design Page? :?:
The same for rows...
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: GridBagLayout Deletion of Component does not correct columns

Postby Eric Clayberg » Tue Jul 28, 2009 6:43 am

This is working as intended. You can right-click on a row or column header to delete that row or column.

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: GridBagLayout Deletion of Component does not correct columns

Postby chrisR » Tue Jul 28, 2009 8:05 am

Thanks Eric,

that was what i was looking for. :D

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

Re: GridBagLayout Deletion of Component does not correct columns

Postby Eric Clayberg » Tue Jul 28, 2009 9:18 am

The docs for the GridBagLayout design time support are here...

http://download.instantiations.com/D2WB ... ayout.html
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