gridlayout issue...

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

gridlayout issue...

Postby Guest » Wed Jan 19, 2005 12:45 pm

hi everybody,
i'm evaluating windowbuilderpro 3.0.1, build 050109, for eclipse 3.1 .

everything works okay, but i experienced one odd thing:
i placed a gridlayout into a swing container (jpanel, jtabbedpane, ...) and set the number of columns to a value. then i entered a value for rows, as soon as i left the textfield the number of cols went back to 0 again??!!
so i changed both values in the source code, when opening it with designer again, both values are in the layout-property, but changing either one results in 0 for the other.

can you help we with this,
many thanks
Guest
 

Re: gridlayout issue...

Postby Eric Clayberg » Wed Jan 19, 2005 1:24 pm

Guest wrote:everything works okay, but i experienced one odd thing:
i placed a gridlayout into a swing container (jpanel, jtabbedpane, ...) and set the number of columns to a value. then i entered a value for rows, as soon as i left the textfield the number of cols went back to 0 again??!!
so i changed both values in the source code, when opening it with designer again, both values are in the layout-property, but changing either one results in 0 for the other.

That is completely intentional. With a GridLayout, you can't constrain both dimensions. If you try, once you exceed the capacity (rows x columns), it will keep the rows constraint and start adding new columns (in effect the columns constrain is ignored). To actually constrain the number of columns, the number of rows must be set to zero. The Designer editor understands this and ensures that the last constraint that you set is put into effect. This requires that the opposite axis be set to zero.
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: Google [Bot] and 1 guest