All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class Dial extends JComponent
A dial that can be turned with the mouse wheel, mouse click+drag, or the keyboard +/- keys.
See Also:
  • Constructor Details

    • Dial

      public Dial()
  • Method Details

    • getChange

      public double getChange()
    • setChange

      public void setChange(double change)
      Set the change value. The change value is the amount the dial moved on the last update.
      Parameters:
      change - the change value
    • getValue

      public double getValue()
      Returns the current value of the dial.
      Returns:
      the current value of the dial, a value between 0 (inclusive) and 360 (exclusive).
    • setValue

      public void setValue(double arg0)
      Set the value of the dial. The value is unconstrained.
      Parameters:
      arg0 - the new value
    • addActionListener

      public void addActionListener(ActionListener listener)
      Subscribe to receivei the "turn" command when the dial is turned.
      Parameters:
      listener - the listener
    • removeActionListener

      public void removeActionListener(ActionListener listener)
    • paintComponent

      public void paintComponent(Graphics g)
    • main

      public static void main(String[] args)