Class CLabel

    • Field Detail

      • DEFAULT_ALIGNMENT

        public static int DEFAULT_ALIGNMENT
    • Constructor Detail

      • CLabel

        public CLabel​(String text,
                      Icon icon,
                      int horizontalAlignment)
        Creates a Label instance with the specified text, image, and horizontal alignment. The label is centered vertically in its display area. The text is on the trailing edge of the image.
        Parameters:
        text - The text to be displayed by the label.
        icon - The image to be displayed by the label.
        horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
      • CLabel

        public CLabel​(String text,
                      int horizontalAlignment)
        Creates a Label instance with the specified text and horizontal alignment. The label is centered vertically in its display area.
        Parameters:
        text - The text to be displayed by the label.
        horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
      • CLabel

        public CLabel​(String text)
        Creates a Label instance with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.
        Parameters:
        text - The text to be displayed by the label.
      • CLabel

        public CLabel​(Icon image,
                      int horizontalAlignment)
        Creates a Label instance with the specified image and horizontal alignment. The label is centered vertically in its display area.
        Parameters:
        image - The image to be displayed by the label.
        horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
      • CLabel

        public CLabel​(Icon image)
        Creates a Label instance with the specified image. The label is centered vertically and horizontally in its display area.
        Parameters:
        image - The image to be displayed by the label.
      • CLabel

        public CLabel()
        Creates a JLabel instance with no image and with an empty string for the title. The label is centered vertically in its display area. The label's contents, once set, will be displayed on the leading edge of the label's display area.
      • CLabel

        public CLabel​(String label,
                      String toolTip)
        Creates a Label instance with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.
        Parameters:
        label - The text to be displayed by the label.
        toolTip - The optional Tooltip text
      • CLabel

        public CLabel​(String label,
                      Component field)
        Trailing Label for Field
        Parameters:
        label - label
        field - field
    • Method Detail

      • setBackground

        public void setBackground​(Color bg)
        Set Background
        Overrides:
        setBackground in class JComponent
        Parameters:
        bg - background
      • setFontBold

        public void setFontBold​(boolean bold)
        Set Font to Bold
        Parameters:
        bold - true bold false normal
      • setText

        public void setText​(String mnemonicLabel)
        Set label text - if it includes &, the next character is the Mnemonic
        Overrides:
        setText in class JLabel
        Parameters:
        mnemonicLabel - Label containing Mnemonic
      • setReadWrite

        public void setReadWrite​(boolean rw)
        Set ReadWrite
        Parameters:
        rw - enabled
      • setLabelFor

        public void setLabelFor​(Component c)
        Set Label For
        Overrides:
        setLabelFor in class JLabel
        Parameters:
        c - component
      • getSavedMnemonic

        public char getSavedMnemonic()
        Returns:
        Returns the savedMnemonic.
      • setSavedMnemonic

        public void setSavedMnemonic​(char savedMnemonic)
        Parameters:
        savedMnemonic - The savedMnemonic to set.