Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
javax.swing

Class LayoutStyle


  • public abstract class LayoutStyle
    extends Object
    LayoutStyle provides information about how to position components. This class is primarily useful for visual tools and layout managers. Most developers will not need to use this class.

    You typically don't set or create a LayoutStyle. Instead use the static method getInstance to obtain the current instance.

    Since:
    1.6
    • Constructor Detail

      • LayoutStyle

        public LayoutStyle()
        Creates a new LayoutStyle. You generally don't create a LayoutStyle. Instead use the method getInstance to obtain the current LayoutStyle.
    • Method Detail

      • setInstance

        public static void setInstance(LayoutStyle style)
        Sets the shared instance of LayoutStyle. Specifying null results in using the LayoutStyle from the current LookAndFeel.
        Parameters:
        style - the LayoutStyle, or null
        See Also:
        getInstance()
      • getInstance

        public static LayoutStyle getInstance()
        Returns the shared instance of LayoutStyle. If an instance has not been specified in setInstance, this will return the LayoutStyle from the current LookAndFeel.
        Returns:
        the shared instance of LayoutStyle
        See Also:
        LookAndFeel.getLayoutStyle()
      • getPreferredGap

        public abstract int getPreferredGap(JComponent component1,
                          JComponent component2,
                          LayoutStyle.ComponentPlacement type,
                          int position,
                          Container parent)
        Returns the amount of space to use between two components. The return value indicates the distance to place component2 relative to component1. For example, the following returns the amount of space to place between component2 and component1 when component2 is placed vertically above component1:
           int gap = getPreferredGap(component1, component2,
                                     ComponentPlacement.RELATED,
                                     SwingConstants.NORTH, parent);
         
        The type parameter indicates the relation between the two components. If the two components will be contained in the same parent and are showing similar logically related items, use RELATED. If the two components will be contained in the same parent but show logically unrelated items use UNRELATED. Some look and feels may not distinguish between the RELATED and UNRELATED types.

        The return value is not intended to take into account the current size and position of component2 or component1. The return value may take into consideration various properties of the components. For example, the space may vary based on font size, or the preferred size of the component.

        Parameters:
        component1 - the JComponent component2 is being placed relative to
        component2 - the JComponent being placed
        position - the position component2 is being placed relative to component1; one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST
        type - how the two components are being placed
        parent - the parent of component2; this may differ from the actual parent and it may be null
        Returns:
        the amount of space to place between the two components
        Throws:
        NullPointerException - if component1, component2 or type is null
        IllegalArgumentException - if position is not one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST
        Since:
        1.6
        See Also:
        LookAndFeel.getLayoutStyle()
      • getContainerGap

        public abstract int getContainerGap(JComponent component,
                          int position,
                          Container parent)
        Returns the amount of space to place between the component and specified edge of its parent.
        Parameters:
        component - the JComponent being positioned
        position - the position component is being placed relative to its parent; one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST
        parent - the parent of component; this may differ from the actual parent and may be null
        Returns:
        the amount of space to place between the component and specified edge
        Throws:
        IllegalArgumentException - if position is not one of SwingConstants.NORTH, SwingConstants.SOUTH, SwingConstants.EAST or SwingConstants.WEST

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

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

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.

Inhaltsverzeichnis Haut