Interface AlignmentSupport

    • Method Detail

      • getHorizontalAlignment

        int getHorizontalAlignment()
        Returns the horizontal alignment of the content. AbstractButton's default is SwingConstants.CENTER, but subclasses such as JCheckBox may use a different default.
        Returns:
        the horizontalAlignment property, one of the following values:
        • SwingConstants.RIGHT
        • SwingConstants.LEFT
        • SwingConstants.CENTER
        • SwingConstants.LEADING
        • SwingConstants.TRAILING
      • setHorizontalAlignment

        void setHorizontalAlignment​(int alignment)
        Sets the horizontal alignment of the content. AbstractButton's default is SwingConstants.CENTER, but subclasses such as JCheckBox may use a different default.
        Parameters:
        alignment - the alignment value, one of the following values:
        • SwingConstants.RIGHT
        • SwingConstants.LEFT
        • SwingConstants.CENTER
        • SwingConstants.LEADING
        • SwingConstants.TRAILING
        Throws:
        java.lang.IllegalArgumentException - if the alignment is not one of the valid values
      • getVerticalAlignment

        int getVerticalAlignment()
        Returns the vertical alignment of the content.
        Returns:
        the verticalAlignment property, one of the following values:
        • SwingConstants.CENTER (the default)
        • SwingConstants.TOP
        • SwingConstants.BOTTOM
      • setVerticalAlignment

        void setVerticalAlignment​(int alignment)
        Sets the vertical alignment of the content.
        Parameters:
        alignment - one of the following values:
        • SwingConstants.CENTER (the default)
        • SwingConstants.TOP
        • SwingConstants.BOTTOM
        Throws:
        java.lang.IllegalArgumentException - if the alignment is not one of the legal values listed above