Class WaitCursor

java.lang.Object
is.codion.swing.common.ui.WaitCursor

public final class WaitCursor extends Object
Utility class for showing a wait cursor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    hide(Window window)
    Removes a wait cursor request for the given window
    static void
    hide(JComponent component)
    Removes a wait cursor request for the parent root pane of the given component, the wait cursor is activated once a request is made, but only deactivated once all such requests have been retracted.
    static void
    show(Window window)
    Adds a wait cursor request for the given window
    static void
    show(JComponent component)
    Adds a wait cursor request for the parent root pane of the given component, the wait cursor is activated once a request is made, but only deactivated once all such requests have been retracted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • show

      public static void show(JComponent component)
      Adds a wait cursor request for the parent root pane of the given component, the wait cursor is activated once a request is made, but only deactivated once all such requests have been retracted. Best used with a try/finally block.
       WaitCursor.show(component);
       try {
         doSomething();
       }
       finally {
         WaitCursor.hide(component);
       }
       
      Parameters:
      component - the component
      See Also:
    • hide

      public static void hide(JComponent component)
      Removes a wait cursor request for the parent root pane of the given component, the wait cursor is activated once a request is made, but only deactivated once all such requests have been retracted. Best used with a try/finally block.
       WaitCursor.show(component);
       try {
         doSomething();
       }
       finally {
         WaitCursor.hide(component);
       }
       
      Parameters:
      component - the component
      See Also:
    • show

      public static void show(Window window)
      Adds a wait cursor request for the given window
      Parameters:
      window - the window
    • hide

      public static void hide(Window window)
      Removes a wait cursor request for the given window
      Parameters:
      window - the window