Class EmphasizedLabelUI

All Implemented Interfaces:
PropertyChangeListener, EventListener

public class EmphasizedLabelUI extends BasicLabelUI

A BasicLabelUI that paints a shadow under the text using the given shadow color, which helps emphasize the text. The UI delegate also provides a facility for drawing a different shadow color when the corresponding label's containing Window is unfocused.

While this UI delegate can be directly installed on existing JLabels, it is recommended that you use the MacWidgetFactory.createEmphasizedLabel(String) or MacWidgetFactory.makeEmphasizedLabel(JLabel, Color, Color, Color) factory methods.

Here's a close-up of an emphasized label:

  • Field Details

    • DEFAULT_EMPHASIS_COLOR

      public static final Color DEFAULT_EMPHASIS_COLOR
    • DEFAULT_FOCUSED_FONT_COLOR

      public static final Color DEFAULT_FOCUSED_FONT_COLOR
    • DEFAULT_UNFOCUSED_FONT_COLOR

      public static final Color DEFAULT_UNFOCUSED_FONT_COLOR
    • DEFAULT_DISABLED_FONT_COLOR

      public static final Color DEFAULT_DISABLED_FONT_COLOR
  • Constructor Details

    • EmphasizedLabelUI

      public EmphasizedLabelUI()
      Creates an EmphasizedLabelUI using the default colors.
    • EmphasizedLabelUI

      public EmphasizedLabelUI(Color focusedTextColor, Color unfocusedTextColor, Color emphasisColor)
      Creates an EmphasizedLabelUI using the given colors.
      Parameters:
      focusedTextColor - the color to draw the text with when the parent Window has focus.
      unfocusedTextColor - the color to draw the text with when the parent Window does not have focus.
      emphasisColor - the color to draw the emphasis text with.
  • Method Details