Class GroupLayout.SequentialGroup
- Enclosing class:
- GroupLayout
public class GroupLayout.SequentialGroup extends GroupLayout.Group
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.
- Since:
- 1.6
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
GroupLayout.SequentialGroup |
addComponent |
Adds a Component to this Group. |
GroupLayout.SequentialGroup |
addComponent |
Adds a Component to this Group with the specified size. |
GroupLayout.SequentialGroup |
addComponent |
Adds a Component to this Group. |
GroupLayout.SequentialGroup |
addComponent |
Adds a Component to this Group with the specified size. |
GroupLayout.SequentialGroup |
addContainerGap() |
Adds an element representing the preferred gap between an edge the container and components that touch the border of the container. |
GroupLayout.SequentialGroup |
addContainerGap |
Adds an element representing the preferred gap between one edge of the container and the next or previous
Component with the specified size. |
GroupLayout.SequentialGroup |
addGap |
Adds a rigid gap to this Group. |
GroupLayout.SequentialGroup |
addGap |
Adds a gap to this Group with the specified size. |
GroupLayout.SequentialGroup |
addGroup |
Adds a Group to this Group. |
GroupLayout.SequentialGroup |
addGroup |
Adds a Group to this Group. |
GroupLayout.SequentialGroup |
addPreferredGap |
Adds an element representing the preferred gap between two components. |
GroupLayout.SequentialGroup |
addPreferredGap |
Adds an element representing the preferred gap between two components. |
GroupLayout.SequentialGroup |
addPreferredGap |
Adds an element representing the preferred gap between the nearest components. |
GroupLayout.SequentialGroup |
addPreferredGap |
Adds an element representing the preferred gap between the nearest components. |
Method Details
addGroup
public GroupLayout.SequentialGroup addGroup(GroupLayout.Group group)
Group to this Group.- Overrides:
-
addGroupin classGroupLayout.Group - Parameters:
-
group- theGroupto add - Returns:
- this
Group
addGroup
public GroupLayout.SequentialGroup addGroup(boolean useAsBaseline, GroupLayout.Group group)
Group to this Group.- Parameters:
-
group- theGroupto add -
useAsBaseline- whether the specifiedGroupshould be used to calculate the baseline for thisGroup - Returns:
- this
Group
addComponent
public GroupLayout.SequentialGroup addComponent(Component component)
Component to this Group.- Overrides:
-
addComponentin classGroupLayout.Group - Parameters:
-
component- theComponentto add - Returns:
- this
Group
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component)
Component to this Group.- Parameters:
-
useAsBaseline- whether the specifiedComponentshould be used to calculate the baseline for thisGroup -
component- theComponentto add - Returns:
- this
Group
addComponent
public GroupLayout.SequentialGroup addComponent(Component component, int min, int pref, int max)
Component to this Group with the specified size.- Overrides:
-
addComponentin classGroupLayout.Group - Parameters:
-
component- theComponentto add -
min- the minimum size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
pref- the preferred size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
max- the maximum size or one ofDEFAULT_SIZEorPREFERRED_SIZE - Returns:
- this
Group
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component, int min, int pref, int max)
Component to this Group with the specified size.- Parameters:
-
useAsBaseline- whether the specifiedComponentshould be used to calculate the baseline for thisGroup -
component- theComponentto add -
min- the minimum size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
pref- the preferred size or one ofDEFAULT_SIZEorPREFERRED_SIZE -
max- the maximum size or one ofDEFAULT_SIZEorPREFERRED_SIZE - Returns:
- this
Group
addGap
public GroupLayout.SequentialGroup addGap(int size)
Group.- Overrides:
-
addGapin classGroupLayout.Group - Parameters:
-
size- the size of the gap - Returns:
- this
Group
addGap
public GroupLayout.SequentialGroup addGap(int min, int pref, int max)
Group with the specified size.- Overrides:
-
addGapin classGroupLayout.Group - Parameters:
-
min- the minimum size of the gap -
pref- the preferred size of the gap -
max- the maximum size of the gap - Returns:
- this
Group
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type)
- Parameters:
-
comp1- the first component -
comp2- the second component -
type- the type of gap; one of the constants defined byLayoutStyle - Returns:
- this
SequentialGroup - Throws:
-
IllegalArgumentException- iftype,comp1orcomp2isnull - See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type, int pref, int max)
- Parameters:
-
comp1- the first component -
comp2- the second component -
type- the type of gap -
pref- the preferred size of the grap; one ofDEFAULT_SIZEor a value >= 0 -
max- the maximum size of the gap; one ofDEFAULT_SIZE,PREFERRED_SIZEor a value >= 0 - Returns:
- this
SequentialGroup - Throws:
-
IllegalArgumentException- iftype,comp1orcomp2isnull - See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type)
0. The element created to represent the gap is not resizable.
- Parameters:
-
type- the type of gap; one ofLayoutStyle.ComponentPlacement.RELATEDorLayoutStyle.ComponentPlacement.UNRELATED - Returns:
- this
SequentialGroup - Throws:
-
IllegalArgumentException- iftypeis not one ofLayoutStyle.ComponentPlacement.RELATEDorLayoutStyle.ComponentPlacement.UNRELATED - See Also:
addPreferredGap
public GroupLayout.SequentialGroup addPreferredGap(LayoutStyle.ComponentPlacement type, int pref, int max)
- Parameters:
-
type- the type of gap; one ofLayoutStyle.ComponentPlacement.RELATEDorLayoutStyle.ComponentPlacement.UNRELATED -
pref- the preferred size of the grap; one ofDEFAULT_SIZEor a value >= 0 -
max- the maximum size of the gap; one ofDEFAULT_SIZE,PREFERRED_SIZEor a value >= 0 - Returns:
- this
SequentialGroup - Throws:
-
IllegalArgumentException- iftypeis not one ofLayoutStyle.ComponentPlacement.RELATEDorLayoutStyle.ComponentPlacement.UNRELATED - See Also:
addContainerGap
public GroupLayout.SequentialGroup addContainerGap()
The element created to represent the gap is not resizable.
- Returns:
- this
SequentialGroup
addContainerGap
public GroupLayout.SequentialGroup addContainerGap(int pref, int max)
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.- Parameters:
-
pref- the preferred size; one ofDEFAULT_SIZEor a value >= 0 -
max- the maximum size; one ofDEFAULT_SIZE,PREFERRED_SIZEor a value >= 0 - Returns:
- this
SequentialGroup
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/GroupLayout.SequentialGroup.html