public class javax.swing
GroupLayout.SequentialGroup


Hide details Login
Java SE 6
  
Extends: javax.swing.GroupLayout.Spring > GroupLayout.Group
Contained within: GroupLayout

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

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


Methods
public GroupLayout.SequentialGroup addComponent(Component component)
Adds a Component to this Group.
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component)
Adds a Component to this Group.
useAsBaselinewhether the specified Component should be used to calculate the baseline for this Group
componentthe Component to add
returnthis Group
public GroupLayout.SequentialGroup addComponent(Component component, int min, int pref, int max)
Adds a Component to this Group with the specified size.
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component, int min, int pref, int max)
Adds a Component to this Group with the specified size.
useAsBaselinewhether the specified Component should be used to calculate the baseline for this Group
componentthe Component to add
minthe minimum size or one of DEFAULT_SIZE or PREFERRED_SIZE
prefthe preferred size or one of DEFAULT_SIZE or PREFERRED_SIZE
maxthe maximum size or one of DEFAULT_SIZE or PREFERRED_SIZE
returnthis Group
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.
returnthis SequentialGroup

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 Component with the specified size. This has no effect if the next or previous element is not a Component and does not touch one edge of the parent container.
prefthe preferred size; one of DEFAULT_SIZE or a value >= 0
maxthe maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
returnthis SequentialGroup
public GroupLayout.SequentialGroup addGap(int size)
Adds a rigid gap to this Group.
public GroupLayout.SequentialGroup addGap(int min, int pref, int max)
Adds a gap to this Group with the specified size.
public GroupLayout.SequentialGroup addGroup(GroupLayout.Group group)
Adds a Group to this Group.
public GroupLayout.SequentialGroup addGroup(boolean useAsBaseline, GroupLayout.Group group)
Adds a Group to this Group.
groupthe Group to add
useAsBaselinewhether the specified Group should be used to calculate the baseline for this Group
returnthis Group
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.
comp1the first component
comp2the second component
typethe type of gap; one of the constants defined by LayoutStyle
returnthis SequentialGroup
ThrowsIllegalArgumentException: if type, comp1 or comp2 is null
See also javax.swing.LayoutStyle
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.
comp1the first component
comp2the second component
typethe type of gap
prefthe preferred size of the grap; one of DEFAULT_SIZE or a value >= 0
maxthe maximum size of the gap; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
returnthis SequentialGroup
ThrowsIllegalArgumentException: if type, comp1 or comp2 is null
See also javax.swing.LayoutStyle
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 0.

The element created to represent the gap is not resizable.
typethe type of gap; one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
returnthis SequentialGroup
ThrowsIllegalArgumentException: if type is not one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
See also javax.swing.LayoutStyle

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.
typethe type of gap; one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
prefthe preferred size of the grap; one of DEFAULT_SIZE or a value >= 0
maxthe maximum size of the gap; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
returnthis SequentialGroup
ThrowsIllegalArgumentException: if type is not one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
See also javax.swing.LayoutStyle