Class GHtmlLabel

All Implemented Interfaces:
GComponent, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, SwingConstants

public class GHtmlLabel extends AbstractHtmlLabel
An immutable label (the text can NOT be changed), with HTML rendering allowed.

Clients do not need to prefix label text with "<html>", as is required for a standard JLabel.

See also:

ClassMutable textHTML renderingDescription
GLabelImmutableNONon-html unchangeable label
GDLabelMutableNONon-html changeable label
GHtmlLabelImmutableYESHtml unchangeable label
GDHtmlLabelMutableYESHtml changeable label
GIconLabelN/ANOLabel that only has an icon image, no text
Other components of note:
GCheckBoxNONon-html checkbox
GHtmlCheckBoxYESHtml checkbox
See Also:
  • Constructor Details

    • GHtmlLabel

      public GHtmlLabel()
      Creates a immutable label with no image and no text, with SwingConstants.LEADING horizontal alignment, with HTML rendering allowed.

      See JLabel().

    • GHtmlLabel

      public GHtmlLabel(String text)
      Creates a immutable label with the specified text, with SwingConstants.LEADING horizontal alignment, with HTML rendering allowed.

      See JLabel(String).

      Parameters:
      text - string to be displayed by the label
  • Method Details

    • setText

      @Deprecated public void setText(String text)
      Deprecated.
      This is a half-way method of turning this label into an immutable instance.

      If the user has a type of "GHtmlLabel", they will see the deprecated warning on calls to setText().

      If there are calls to setText() after the initial value has been set by the constructor, a warning will be printed in the log.

      Overrides:
      setText in class AbstractHtmlLabel
      Parameters:
      text - string this label will display