- java.lang.Object
-
- javax.swing.GroupLayout.Group
-
- javax.swing.GroupLayout.SequentialGroup
-
- Enclosing class:
- GroupLayout
public class GroupLayout.SequentialGroup extends GroupLayout.Group
AGroup
that positions and sizes its elements sequentially, one after another. This class has no public constructor, use thecreateSequentialGroup
method to create one.In order to align a
SequentialGroup
along the baseline of a baseline alignedParallelGroup
you need to specify which of the elements of theSequentialGroup
is used to determine the baseline. The element used to calculate the baseline is specified using one of theadd
methods that take aboolean
. The last element added with a value oftrue
foruseAsBaseline
is used to calculate the baseline.- Since:
- 1.6
- See Also:
GroupLayout.createSequentialGroup()
-
-
Method Summary
Methods Modifier and Type Method and Description GroupLayout.SequentialGroup
addComponent(boolean useAsBaseline, Component component)
Adds aComponent
to thisGroup
.GroupLayout.SequentialGroup
addComponent(boolean useAsBaseline, Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
with the specified size.GroupLayout.SequentialGroup
addComponent(Component component)
Adds aComponent
to thisGroup
.GroupLayout.SequentialGroup
addComponent(Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
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(int pref, int max)
Adds an element representing the preferred gap between one edge of the container and the next or previousComponent
with the specified size.GroupLayout.SequentialGroup
addGap(int size)
Adds a rigid gap to thisGroup
.GroupLayout.SequentialGroup
addGap(int min, int pref, int max)
Adds a gap to thisGroup
with the specified size.GroupLayout.SequentialGroup
addGroup(boolean useAsBaseline, GroupLayout.Group group)
Adds aGroup
to thisGroup
.GroupLayout.SequentialGroup
addGroup(GroupLayout.Group group)
Adds aGroup
to thisGroup
.GroupLayout.SequentialGroup
addPreferredGap(JComponent comp1, JComponent comp2, LayoutStyle.ComponentPlacement type)
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
addPreferredGap(LayoutStyle.ComponentPlacement type)
Adds an element representing the preferred gap between the nearest components.GroupLayout.SequentialGroup
addPreferredGap(LayoutStyle.ComponentPlacement type, int pref, int max)
Adds an element representing the preferred gap between the nearest components.
-
-
-
Method Detail
-
addGroup
public GroupLayout.SequentialGroup addGroup(GroupLayout.Group group)
Adds aGroup
to thisGroup
.- Overrides:
addGroup
in classGroupLayout.Group
- Parameters:
group
- theGroup
to add- Returns:
- this
Group
-
addGroup
public GroupLayout.SequentialGroup addGroup(boolean useAsBaseline, GroupLayout.Group group)
Adds aGroup
to thisGroup
.- Parameters:
group
- theGroup
to adduseAsBaseline
- whether the specifiedGroup
should be used to calculate the baseline for thisGroup
- Returns:
- this
Group
-
addComponent
public GroupLayout.SequentialGroup addComponent(Component component)
Adds aComponent
to thisGroup
.- Overrides:
addComponent
in classGroupLayout.Group
- Parameters:
component
- theComponent
to add- Returns:
- this
Group
-
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component)
Adds aComponent
to thisGroup
.- Parameters:
useAsBaseline
- whether the specifiedComponent
should be used to calculate the baseline for thisGroup
component
- theComponent
to add- Returns:
- this
Group
-
addComponent
public GroupLayout.SequentialGroup addComponent(Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
with the specified size.- Overrides:
addComponent
in classGroupLayout.Group
- Parameters:
component
- theComponent
to addmin
- the minimum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
pref
- the preferred size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
max
- the maximum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
- Returns:
- this
Group
-
addComponent
public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline, Component component, int min, int pref, int max)
Adds aComponent
to thisGroup
with the specified size.- Parameters:
useAsBaseline
- whether the specifiedComponent
should be used to calculate the baseline for thisGroup
component
- theComponent
to addmin
- the minimum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
pref
- the preferred size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
max
- the maximum size or one ofDEFAULT_SIZE
orPREFERRED_SIZE
- Returns:
- this
Group
-
addGap
public GroupLayout.SequentialGroup addGap(int size)
Adds a rigid gap to thisGroup
.- Overrides:
addGap
in classGroupLayout.Group
- Parameters:
size
- the size of the gap- Returns:
- this
Group
-
addGap
public GroupLayout.SequentialGroup addGap(int min, int pref, int max)
Adds a gap to thisGroup
with the specified size.- Overrides:
addGap
in classGroupLayout.Group
- Parameters:
min
- the minimum size of the gappref
- the preferred size of the gapmax
- the maximum size of the gap- Returns:
- this
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 componentcomp2
- the second componenttype
- the type of gap; one of the constants defined byLayoutStyle
- Returns:
- this
SequentialGroup
- Throws:
IllegalArgumentException
- iftype
,comp1
orcomp2
isnull
- See Also:
LayoutStyle
-
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 componentcomp2
- the second componenttype
- the type of gappref
- the preferred size of the grap; one ofDEFAULT_SIZE
or a value >= 0max
- the maximum size of the gap; one ofDEFAULT_SIZE
,PREFERRED_SIZE
or a value >= 0- Returns:
- this
SequentialGroup
- Throws:
IllegalArgumentException
- iftype
,comp1
orcomp2
isnull
- See Also:
LayoutStyle
-
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 of0
.The element created to represent the gap is not resizable.
- Parameters:
type
- the type of gap; one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
- Returns:
- this
SequentialGroup
- Throws:
IllegalArgumentException
- iftype
is not one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
- See Also:
LayoutStyle
-
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 ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
pref
- the preferred size of the grap; one ofDEFAULT_SIZE
or a value >= 0max
- the maximum size of the gap; one ofDEFAULT_SIZE
,PREFERRED_SIZE
or a value >= 0- Returns:
- this
SequentialGroup
- Throws:
IllegalArgumentException
- iftype
is not one ofLayoutStyle.ComponentPlacement.RELATED
orLayoutStyle.ComponentPlacement.UNRELATED
- See Also:
LayoutStyle
-
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
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 previousComponent
with the specified size. This has no effect if the next or previous element is not aComponent
and does not touch one edge of the parent container.- Parameters:
pref
- the preferred size; one ofDEFAULT_SIZE
or a value >= 0max
- the maximum size; one ofDEFAULT_SIZE
,PREFERRED_SIZE
or a value >= 0- Returns:
- this
SequentialGroup
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/swing/grouplayout.sequentialgroup.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.