javax.swing

Class GroupLayout.SequentialGroup

  • Enclosing class:
    GroupLayout

    public class GroupLayout.SequentialGroup
    extends GroupLayout.Group
    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.

    Since:
    1.6
    See Also:
    GroupLayout.createSequentialGroup()
    • Method Detail

      • addGroup

        public GroupLayout.SequentialGroup addGroup(boolean useAsBaseline,
                                           GroupLayout.Group group)
        Adds a Group to this Group.
        Parameters:
        group - the Group to add
        useAsBaseline - whether the specified Group should be used to calculate the baseline for this Group
        Returns:
        this Group
      • addComponent

        public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline,
                                               Component component)
        Adds a Component to this Group.
        Parameters:
        useAsBaseline - whether the specified Component should be used to calculate the baseline for this Group
        component - the Component to add
        Returns:
        this Group
      • addComponent

        public GroupLayout.SequentialGroup addComponent(Component component,
                                               int min,
                                               int pref,
                                               int max)
        Adds a Component to this Group with the specified size.
        Overrides:
        addComponent in class GroupLayout.Group
        Parameters:
        component - the Component to add
        min - the minimum size or one of DEFAULT_SIZE or PREFERRED_SIZE
        pref - the preferred size or one of DEFAULT_SIZE or PREFERRED_SIZE
        max - the maximum size or one of DEFAULT_SIZE or PREFERRED_SIZE
        Returns:
        this Group
      • addComponent

        public GroupLayout.SequentialGroup addComponent(boolean useAsBaseline,
                                               Component component,
                                               int min,
                                               int pref,
                                               int max)
        Adds a Component to this Group with the specified size.
        Parameters:
        useAsBaseline - whether the specified Component should be used to calculate the baseline for this Group
        component - the Component to add
        min - the minimum size or one of DEFAULT_SIZE or PREFERRED_SIZE
        pref - the preferred size or one of DEFAULT_SIZE or PREFERRED_SIZE
        max - the maximum size or one of DEFAULT_SIZE or PREFERRED_SIZE
        Returns:
        this Group
      • addGap

        public GroupLayout.SequentialGroup addGap(int min,
                                         int pref,
                                         int max)
        Adds a gap to this Group with the specified size.
        Overrides:
        addGap in class GroupLayout.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,
                                                  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 DEFAULT_SIZE or a value >= 0
        max - the maximum size of the gap; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
        Returns:
        this SequentialGroup
        Throws:
        IllegalArgumentException - if type, comp1 or comp2 is null
        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 of 0.

        The element created to represent the gap is not resizable.

        Parameters:
        type - the type of gap; one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
        Returns:
        this SequentialGroup
        Throws:
        IllegalArgumentException - if type is not one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.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 of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.ComponentPlacement.UNRELATED
        pref - the preferred size of the grap; one of DEFAULT_SIZE or a value >= 0
        max - the maximum size of the gap; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
        Returns:
        this SequentialGroup
        Throws:
        IllegalArgumentException - if type is not one of LayoutStyle.ComponentPlacement.RELATED or LayoutStyle.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 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.
        Parameters:
        pref - the preferred size; one of DEFAULT_SIZE or a value >= 0
        max - the maximum size; one of DEFAULT_SIZE, PREFERRED_SIZE or a value >= 0
        Returns:
        this SequentialGroup

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/swing/GroupLayout.SequentialGroup.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut