File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Layout manager question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Layout manager question" Watch "Layout manager question" New topic
Author

Layout manager question

Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Do CardLayout and GridBagLayout managers
honor components' preferred sizes? Thanks.
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
From the API:
GridBagLayout:
...In addition to its constraints object, the GridBagLayout also considers each component's minimum and preferred sizes in order to
determine a component's size.

In addition I'd say that GridBagLayout honors the components preferred size as long as you don't use constraints which tell the layout manager to do otherwise (like the GridBadConstraints.fill member)
From the API:
CardLayout method layoutContainer:
Each component in the parent container is reshaped to be the size of the container, minus space for surrounding insets, horizontal gaps, and vertical gaps.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Layout manager question
 
Similar Threads
Unable to launch Tomcat from eclipse.
WA #1.....word association
exact english word
Implementing Lean Software Development
Parachutes