This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing
class GroupLayout.Group

javax.swing.GroupLayout.Group
Direct Known Subclasses:
GroupLayout.ParallelGroup, GroupLayout.SequentialGroup
Enclosing class:
GroupLayout

public abstract class GroupLayout.Group
extends GroupLayout.Spring

{@code Group} provides the basis for the two types of operations supported by {@code GroupLayout}: laying out components one after another ({@link SequentialGroup SequentialGroup}) or aligned ({@link ParallelGroup ParallelGroup}). {@code Group} and its subclasses have no public constructor; to create one use one of {@code createSequentialGroup} or {@code createParallelGroup}. Additionally, taking a {@code Group} created from one {@code GroupLayout} and using it with another will produce undefined results.

Various methods in {@code Group} and its subclasses allow you to explicitly specify the range. The arguments to these methods can take two forms, either a value greater than or equal to 0, or one of {@code DEFAULT_SIZE} or {@code PREFERRED_SIZE}. A value greater than or equal to {@code 0} indicates a specific size. {@code DEFAULT_SIZE} indicates the corresponding size from the component should be used. For example, if {@code DEFAULT_SIZE} is passed as the minimum size argument, the minimum size is obtained from invoking {@code getMinimumSize} on the component. Likewise, {@code PREFERRED_SIZE} indicates the value from {@code getPreferredSize} should be used. The following example adds {@code myComponent} to {@code group} with specific values for the range. That is, the minimum is explicitly specified as 100, preferred as 200, and maximum as 300.

   group.addComponent(myComponent, 100, 200, 300);
 
The following example adds {@code myComponent} to {@code group} using a combination of the forms. The minimum size is forced to be the same as the preferred size, the preferred size is determined by using {@code myComponent.getPreferredSize} and the maximum is determined by invoking {@code getMaximumSize} on the component.
   group.addComponent(myComponent, GroupLayout.PREFERRED_SIZE,
             GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE);
 

Unless otherwise specified all the methods of {@code Group} and its subclasses that allow you to specify a range throw an {@code IllegalArgumentException} if passed an invalid range. An invalid range is one in which any of the values are < 0 and not one of {@code PREFERRED_SIZE} or {@code DEFAULT_SIZE}, or the following is not met (for specific values): {@code min} <= {@code pref} <= {@code max}.

Similarly any methods that take a {@code Component} throw a {@code NullPointerException} if passed {@code null} and any methods that take a {@code Group} throw an {@code IllegalArgumentException} if passed {@code null}.


Method Summary
 GroupLayout.Group

          Adds a to this .
 GroupLayout.Group
addComponent(Component component, int min, int pref, int max)

          Adds a to this with the specified size.
 GroupLayout.Group
addGap(int size)

          Adds a rigid gap to this .
 GroupLayout.Group
addGap(int min, int pref, int max)

          Adds a gap to this with the specified size.
 GroupLayout.Group

          Adds a to this .
 

Method Detail

addComponent

public GroupLayout.Group addComponent(Component component)
Adds a {@code Component} to this {@code Group}.

Parameters:
component - the {@code Component} to add
Returns:
this {@code Group}

addComponent

public GroupLayout.Group addComponent(Component component,
                                      int min,
                                      int pref,
                                      int max)
Adds a {@code Component} to this {@code Group} with the specified size.

Parameters:
component - the {@code Component} to add
min - the minimum size or one of {@code DEFAULT_SIZE} or {@code PREFERRED_SIZE}
pref - the preferred size or one of {@code DEFAULT_SIZE} or {@code PREFERRED_SIZE}
max - the maximum size or one of {@code DEFAULT_SIZE} or {@code PREFERRED_SIZE}
Returns:
this {@code Group}

addGap

public GroupLayout.Group addGap(int size)
Adds a rigid gap to this {@code Group}.

Parameters:
size - the size of the gap
Returns:
this {@code Group}

addGap

public GroupLayout.Group addGap(int min,
                                int pref,
                                int max)
Adds a gap to this {@code Group} with the specified size.

Parameters:
min - the minimum size of the gap
pref - the preferred size of the gap
max - the maximum size of the gap
Returns:
this {@code Group}

addGroup

public GroupLayout.Group addGroup(GroupLayout.Group group)
Adds a {@code Group} to this {@code Group}.

Parameters:
group - the {@code Group} to add
Returns:
this {@code Group}


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.