Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2005

Tip: Looking for answers? Try searching our database.

New GridBagLayout implementation

Thread view: 
Nobody - 09 Jan 2005 16:34 GMT
Hi,

Does any know any new free implementation of the GridBagLayout. I
think the current implementation of Sun is very bad.

* One of the larges problems is the layout jump if the size is to
small to use the PreferredSize. Then the Sun implementation is
ignoring the PreferredSize and is only used the MinimumSize. The rest
size is used with weightx and weighty. Because the size relations are
different with PreferredSize and MinimumSize there is a jump. In the
most case one or more components is larger as it PreferredSize.

* Another large problem if the size is to small for MinimumSize. Then
the first Components are set to a size of 0. Other components are
zoomed.

* The third problem with the Sun implementation is that the behaviour
is different between different Java version.

Can any give me a link to another implementation? Thanks for your
help.

Volker
Andrey Kuznetsov - 09 Jan 2005 18:55 GMT
> Does any know any new free implementation of the GridBagLayout. I
> think the current implementation of Sun is very bad.
[quoted text clipped - 14 lines]
>
> Can any give me a link to another implementation?

http://mindprod.com/jgloss/layout.html

See also a few posts below - there are just the same question

Signature

Andrey Kuznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

Larry Barowski - 09 Jan 2005 20:36 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> different with PreferredSize and MinimumSize there is a jump. In the
> most case one or more components is larger as it PreferredSize.

I agree completely. GBL is great above preferred size, but the
behavior below preferred size is not usually what you want.

This could be corrected by ignoring weightx and weighty between
the minimum and preferred sizes, and just giving each component
a size in each direction of :   component_min_size +
C * (component_pref_size - component_min_size)  , where C is
computed in the obvious way as a floating point number. The
roundoff error in converting this to integer sizes would need to be
handled in such a way that no minimum size or preferred size is
violated.

> * Another large problem if the size is to small for MinimumSize. Then
> the first Components are set to a size of 0. Other components are
> zoomed.

What happens with the current (1.5) implementation is that it
computes "negative" available space, so the components with
the largest weight get the most extra "negative" size - they get
reduced the most, which is the opposite of what you would
normally want.

This could be handled as above,  size = C * component_min_size  .

> * The third problem with the Sun implementation is that the behaviour
> is different between different Java version.
>
> Can any give me a link to another implementation? Thanks for your
> help.

You could make one - it isn't that difficult.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.