Class VerticalLabel

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener

public class VerticalLabel extends JComponent implements PropertyChangeListener
Display a text vertically (text is rotated on the left).
See Also:
  • Constructor Details

    • VerticalLabel

      public VerticalLabel()
      Create a vertical label with "Text" label and center position.
    • VerticalLabel

      public VerticalLabel(String label)
      Create a vertical label with center position.
    • VerticalLabel

      public VerticalLabel(String label, int position)
      Parameters:
      label -
      position -
  • Method Details

    • setLabel

      public void setLabel(String label)
      sets the label to the given string, and invalidating the layout if the size changes
      Parameters:
      label -
    • getLabel

      public String getLabel()
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Checks for changes to the font on the fComponent so that it can invalidate the layout if the size changes
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e -
    • paintComponent

      public void paintComponent(Graphics g)
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getPosition

      public int getPosition()
      Returns:
      the position
    • setPosition

      public void setPosition(int position)
      Parameters:
      position - the position to set