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 / February 2008

Tip: Looking for answers? Try searching our database.

question about layout

Thread view: 
Adam Sandler - 08 Feb 2008 03:43 GMT
I have a question about Swing development.  I've ran the tutorial for
Eclipse's VE and read http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html

Now, depending on which layout manager I use, my components (like a
JButton for example) take the size of their container.  When using
gridbag layout with Eclipse VE,I can never explicitly position that
Jbutton.  It gets put at 0,0 or 0,1 for example, but I can never
really control exactly where the component goes.  If the frame gets
resized, then that's a whole other set of issues to solve.

I have seen some really nice Swing UIs out there - buttons that stay
in the same place, keep the same size, and the GUI looks the same
regardless of the size of the frame or form.

How do those developers do it?  How can I produce really professional
looking Swing UIs?  Suggestions are greatly appreciated.

Thanks!
Roedy Green - 08 Feb 2008 07:58 GMT
On Thu, 7 Feb 2008 19:43:18 -0800 (PST), Adam Sandler
<corn29@excite.com> wrote, quoted or indirectly quoted someone who
said :

>How do those developers do it?  How can I produce really professional
>looking Swing UIs?  Suggestions are greatly appreciated.

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

Jgoodies makes some layouts that give you finer control over the
details.

You can also write your own.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Boris Stumm - 08 Feb 2008 08:48 GMT
> Now, depending on which layout manager I use, my components (like a
> JButton for example) take the size of their container.  When using
> gridbag layout with Eclipse VE,I can never explicitly position that
> Jbutton.  It gets put at 0,0 or 0,1 for example, but I can never
> really control exactly where the component goes.  If the frame gets
> resized, then that's a whole other set of issues to solve.

GridbagLayout is my worst enemy. I personally like GroupLayout,
although it takes a bit to get used to it.
RedGrittyBrick - 08 Feb 2008 09:21 GMT
> I have a question about Swing development.  I've ran the tutorial for
> Eclipse's VE and read http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html
[quoted text clipped - 12 lines]
> How do those developers do it?  How can I produce really professional
> looking Swing UIs?  Suggestions are greatly appreciated.

The approach I use is ...

1) Don't use VE. Hand code the layouts.
2) Get to understand the various standard layout managers.
3) Nest layouts when appropriate.
4) Consider 3rd-party Layout Managers
   - JGoodies (widely respected.)
   - MigLayout (one I'd strongly recommend.)

Post an ASCII sketch of your desired layout, before and after resizing.


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.