Class JideLabel

All Implemented Interfaces:
Alignable, AlignmentSupport, ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class JideLabel extends JLabel implements Alignable, AlignmentSupport
Just like JideButton comparing to JButton, JideLabel is like JLabel except it is used on JToolBar or CommandBar. However it doesn't look any different from a regular JLabel unless you override "JideLabel.foreground", "JideLabel.background", or "JideLabel.font" etc UIDefaults.

JideLabel also can be used in a vertical layout. If you call setOrientation(int) and set it to SwingConstants.VERTICAL, the text and icon on the label will be laid out vertically. As CommandBar supports vertical layout, this is perfect for it. You can also control the rotating direction by calling setClockwise(boolean). By default, it rotates clockwise.

See Also:
  • Field Details

  • Constructor Details

    • JideLabel

      public JideLabel()
    • JideLabel

      public JideLabel(String text)
    • JideLabel

      public JideLabel(Icon image, int horizontalAlignment)
    • JideLabel

      public JideLabel(Icon image)
    • JideLabel

      public JideLabel(String text, int horizontalAlignment)
    • JideLabel

      public JideLabel(String text, Icon icon, int horizontalAlignment)
  • Method Details

    • updateUI

      public void updateUI()
      Resets the UI property to a value from the current look and feel.
      Overrides:
      updateUI in class JLabel
      See Also:
    • getUIClassID

      public String getUIClassID()
      Returns a string that specifies the name of the L&F class that renders this component.
      Overrides:
      getUIClassID in class JLabel
      Returns:
      the string "ButtonUI"
      See Also:
    • getOrientation

      public int getOrientation()
      The button orientation.
      Specified by:
      getOrientation in interface Alignable
      Returns:
      the orientation.
    • setOrientation

      public void setOrientation(int orientation)
      Description copied from interface: Alignable
      Changes the orientation. If the component is a Swing component, the default implementation is this.
      JideSwingUtilities.setOrientationOf(this, orientation);
      Specified by:
      setOrientation in interface Alignable
      Parameters:
      orientation - the new orientation
    • supportVerticalOrientation

      public boolean supportVerticalOrientation()
      return true if it supports vertical orientation.
      Specified by:
      supportVerticalOrientation in interface Alignable
      Returns:
      true if it supports vertical orientation
    • supportHorizontalOrientation

      public boolean supportHorizontalOrientation()
      return true if it supports horizontal orientation.
      Specified by:
      supportHorizontalOrientation in interface Alignable
      Returns:
      true if it supports horizontal orientation
    • isClockwise

      public boolean isClockwise()
      Checks if the rotation is clockwise.
      Returns:
      true or false.
    • setClockwise

      public void setClockwise(boolean clockwise)
      Sets the rotation direction.
      Parameters:
      clockwise - true or false.