Class JProgressSpinner

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class JProgressSpinner extends JComponent
Provide a Mac-like spinning wheel during long processes
See Also:
  • Field Details

  • Constructor Details

    • JProgressSpinner

      public JProgressSpinner()
    • JProgressSpinner

      public JProgressSpinner(int preferredSize, boolean spinning)
    • JProgressSpinner

      public JProgressSpinner(int preferredSize)
    • JProgressSpinner

      public JProgressSpinner(boolean spinning)
    • JProgressSpinner

      public JProgressSpinner(javafx.beans.binding.BooleanExpression model)
      Parameters:
      model -
      Since:
      13
    • JProgressSpinner

      public JProgressSpinner(int preferredSize, javafx.beans.binding.BooleanExpression model)
      Parameters:
      model -
      Since:
      13
  • Method Details

    • setModel

      public void setModel(javafx.beans.binding.BooleanExpression model)
    • getModel

      public javafx.beans.binding.BooleanExpression getModel()
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • getPhase

      public int getPhase()
      Returns:
      Current phase (angle of most recent tick mark)
    • setPhase

      public void setPhase(int phase)
      Set angle on most recent tick mark
      Parameters:
      phase - number between 0 and nTicks-1
    • advancePhase

      public void advancePhase()
      Move most recent tick mark one step clockwise
    • getDelay

      public int getDelay()
      Get time between animation frames
      Returns:
      time in ms
    • setDelay

      public void setDelay(int delay)
      Set time between animation frames
      Parameters:
      delay - delay in ms
    • isHidden

      public boolean isHidden()
      Tell if ticks are showing
    • setHidden

      public void setHidden(boolean hidden)
      Decide if ticks are to show. Available as an alternative to setVisible as setVisible(false) cases the layout manager to ignore reserving space for component
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class JComponent
    • workStarted

      public void workStarted()
    • workDone

      public void workDone()
    • isSpinning

      public boolean isSpinning()
      Is there an ongoing animation?
    • setSpinning

      public void setSpinning(boolean spinning)
      Decide if progress spinner is to animate or not
    • getPreferredSize

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

      public static void main(String[] args)