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.SequentialGroup

javax.swing.GroupLayout.Group extended by javax.swing.GroupLayout.SequentialGroup
Enclosing class:
GroupLayout

Most common way to construct:

GroupLayout layout = …;

GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();

Based on 249 examples


public class GroupLayout.SequentialGroup
extends GroupLayout.Group

A {@code Group} that positions and sizes its elements sequentially, one after another. This class has no public constructor, use the {@code createSequentialGroup} method to create one.

In order to align a {@code SequentialGroup} along the baseline of a baseline aligned {@code ParallelGroup} you need to specify which of the elements of the {@code SequentialGroup} is used to determine the baseline. The element used to calculate the baseline is specified using one of the {@code add} methods that take a {@code boolean}. The last element added with a value of {@code true} for {@code useAsBaseline} is used to calculate the baseline.


Method Summary
 GroupLayout.SequentialGroup
addComponent(boolean useAsBaseline, Component component)

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

          Adds a to this with the specified size.
 GroupLayout.SequentialGroup

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

          Adds a to this .
 GroupLayout.SequentialGroup

          Adds an element representing the preferred gap between an edge the container and components that touch the border of the container.
 GroupLayout.SequentialGroup
addContainerGap(int pref, int max)

          Adds an element representing the preferred gap between one edge of the container and the next or previous with the specified size.
 GroupLayout.SequentialGroup
addGap(int size)

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

          Adds a rigid gap to this .
 GroupLayout.SequentialGroup
addGroup(boolean useAsBaseline, GroupLayout.Group group)

          Adds a to this .
 GroupLayout.SequentialGroup

          Adds a to this .
 GroupLayout.SequentialGroup

          Adds an element representing the preferred gap between two components.
 GroupLayout.SequentialGroup
addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type, int pref, int max)

          Adds an element representing the preferred gap between two components.
 GroupLayout.SequentialGroup

          Adds an element representing the preferred gap between the nearest components.
 GroupLayout.SequentialGroup

          Adds an element representing the preferred gap between the nearest components.
 
Methods inherited from class javax.swing.GroupLayout.Group
addComponent, addComponent, addGap, addGap, addGroup
 

Method Detail

addComponent

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

Parameters:
useAsBaseline - whether the specified {@code Component} should be used to calculate the baseline for this {@code Group}
component - the {@code Component} to add
Returns:
this {@code Group}

addComponent

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

Parameters:
useAsBaseline - whether the specified {@code Component} should be used to calculate the baseline for this {@code Group}
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}

addComponent

public GroupLayout.SequentialGroup addComponent(Component component)
{@inheritDoc}

Overrides:
addComponent in class GroupLayout.Group
Parameters:
component

addComponent

public GroupLayout.SequentialGroup addComponent(Component component,
                                                int min,
                                                int pref,
                                                int max)
{@inheritDoc}

Overrides:
addComponent in class GroupLayout.Group
Parameters:
component
min
pref
max

addContainerGap

public GroupLayout.SequentialGroup addContainerGap()
Adds an element representing the preferred gap between an edge the container and components that touch the border of the container. This has no effect if the added gap does not touch an edge of the parent container.

The element created to represent the gap is not resizable.

Returns:
this {@code SequentialGroup}

addContainerGap

public GroupLayout.SequentialGroup addContainerGap(int pref,
                                                   int max)
Adds an element representing the preferred gap between one edge of the container and the next or previous {@code Component} with the specified size. This has no effect if the next or previous element is not a {@code Component} and does not touch one edge of the parent container.

Parameters:
pref - the preferred size; one of {@code DEFAULT_SIZE} or a value >= 0
max - the maximum size; one of {@code DEFAULT_SIZE}, {@code PREFERRED_SIZE} or a value >= 0
Returns:
this {@code SequentialGroup}

addGap

public GroupLayout.SequentialGroup addGap(int size)
{@inheritDoc}

Overrides:
addGap in class GroupLayout.Group
Parameters:
size

addGap

public GroupLayout.SequentialGroup addGap(int min,
                                          int pref,
                                          int max)
{@inheritDoc}

Overrides:
addGap in class GroupLayout.Group
Parameters:
min
pref
max

addGroup

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

Parameters:
useAsBaseline - whether the specified {@code Group} should be used to calculate the baseline for this {@code Group}
group - the {@code Group} to add
Returns:
this {@code Group}

addGroup

public GroupLayout.SequentialGroup addGroup(GroupLayout.Group group)
{@inheritDoc}

Overrides:
addGroup in class GroupLayout.Group
Parameters:
group

addPreferredGap

public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1,
                                                   JComponent comp2,
                                                   LayoutStyle.ComponentPlacement type)
Adds an element representing the preferred gap between two components. The element created to represent the gap is not resizable.

Parameters:
comp1 - the first component
comp2 - the second component
type - the type of gap; one of the constants defined by {@code LayoutStyle}
Returns:
this {@code SequentialGroup}

addPreferredGap

public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1,
                                                   JComponent comp2,
                                                   LayoutStyle.ComponentPlacement type,
                                                   int pref,
                                                   int max)
Adds an element representing the preferred gap between two components.

Parameters:
comp1 - the first component
comp2 - the second component
type - the type of gap
pref - the preferred size of the grap; one of {@code DEFAULT_SIZE} or a value >= 0
max - the maximum size of the gap; one of {@code DEFAULT_SIZE}, {@code PREFERRED_SIZE} or a value >= 0
Returns:
this {@code SequentialGroup}

addPreferredGap

public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type)
Adds an element representing the preferred gap between the nearest components. During layout, neighboring components are found, and the size of the added gap is set based on the preferred gap between the components. If no neighboring components are found the gap has a size of {@code 0}.

The element created to represent the gap is not resizable.

Parameters:
type - the type of gap; one of {@code LayoutStyle.ComponentPlacement.RELATED} or {@code LayoutStyle.ComponentPlacement.UNRELATED}
Returns:
this {@code SequentialGroup}

addPreferredGap

public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type,
                                                   int pref,
                                                   int max)
Adds an element representing the preferred gap between the nearest components. During layout, neighboring components are found, and the minimum of this gap is set based on the size of the preferred gap between the neighboring components. If no neighboring components are found the minimum size is set to 0.

Parameters:
type - the type of gap; one of {@code LayoutStyle.ComponentPlacement.RELATED} or {@code LayoutStyle.ComponentPlacement.UNRELATED}
pref - the preferred size of the grap; one of {@code DEFAULT_SIZE} or a value >= 0
max - the maximum size of the gap; one of {@code DEFAULT_SIZE}, {@code PREFERRED_SIZE} or a value >= 0
Returns:
this {@code SequentialGroup}


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/.