Skip navigation links
org.jdesktop.swingx

Class JXHeader

    • Constructor Detail

      • JXHeader

        public JXHeader()
        Creates a new instance of JXHeader
      • JXHeader

        public JXHeader(String title,
                        String description)
        Creates a new instance of JXHeader. PropertyChangeEvents are fired when the title and description properties are set.
        Parameters:
        title - specifies the title property for this JXHeader
        description - specifies the description property for this JXHeader
      • JXHeader

        public JXHeader(String title,
                        String description,
                        Icon icon)
        Creates a new instance of JXHeader. PropertyChangeEvents are fired when the title and description properties are set.
        Parameters:
        title - specifies the title property for this JXHeader
        description - specifies the description property for this JXHeader
        icon - specifies the icon property for this JXHeader
    • Method Detail

      • updateUI

        public void updateUI()
        Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.
        Overrides:
        updateUI in class JPanel
        See Also:
        JComponent.updateUI()
      • setTitle

        public void setTitle(String title)
        Sets the title to use. This may be either plain text, or a simplified version of HTML, as JLabel would use.
        Parameters:
        title - the Title. May be null.
      • getTitle

        public String getTitle()
        Gets the title. This may use HTML, such as that supported by JLabel (version 3.2 of the HTML spec).
        Returns:
        the title. May be null.
      • setDescription

        public void setDescription(String description)
        Sets the description for this header. This may use HTML, such as that supported by JLabel (version 3.2 of the HTML spec).
        Parameters:
        description - the description. May be null, may be HTML or plain text.
      • getDescription

        public String getDescription()
        Gets the description.
        Returns:
        description
      • setIcon

        public void setIcon(Icon icon)
        Sets the icon to use for the header. It is generally recommended that this be an image 64x64 pixels in size, and that the icon have no gaps at the top.
        Parameters:
        icon - may be null
      • getIcon

        public Icon getIcon()
        Gets the icon.
        Returns:
        the Icon being used. May be null.
      • setTitleFont

        public void setTitleFont(Font font)
        Sets new font for title.
        Parameters:
        font - New title font.
      • getTitleFont

        public Font getTitleFont()
        Gets title font.
        Returns:
        the Font being used. May be null.
      • setDescriptionFont

        public void setDescriptionFont(Font font)
        Sets font for the description line of header.
        Parameters:
        font - New description font.
      • getDescriptionFont

        public Font getDescriptionFont()
        Gets description font.
        Returns:
        the Font being used. May be null.
      • getTitleForeground

        public Color getTitleForeground()
        Gets current title foreground color.
        Returns:
        the Color used to paint title. May be null.
      • setTitleForeground

        public void setTitleForeground(Color titleForeground)
        Sets title foreground color.
        Parameters:
        titleForeground - the Color to be used to paint title.
      • getDescriptionForeground

        public Color getDescriptionForeground()
        Gets current description foreground color.
        Returns:
        the Color used to paint description. May be null.
      • setDescriptionForeground

        public void setDescriptionForeground(Color descriptionForeground)
        Sets description foreground color.
        Parameters:
        descriptionForeground - the Color to be used to paint description.
      • getIconPosition

        public JXHeader.IconPosition getIconPosition()
        Gets current icon position. Default is RIGHT.
        Returns:
        Current Icon position.
      • setIconPosition

        public void setIconPosition(JXHeader.IconPosition iconPosition)
        Sets new Icon position. Position is relative to the text. Default value is RIGHT.
        Parameters:
        iconPosition - new desired icon position
        See Also:
        getIconPosition()

Copyright © 2020. All rights reserved.