Class SwingOps

java.lang.Object
org.bzdev.swing.SwingOps

public class SwingOps extends Object
Additional Swing utilities.
  • Constructor Details

    • SwingOps

      public SwingOps()
  • Method Details

    • tryRequestFocusInWindow

      public static void tryRequestFocusInWindow(Component target, int limit)
      Try Component.requestFocusInWindow() on a target component repeatedly until that method succeeds or until an iteration count is exceeded. Between each try, the event dispatch thread is emptied by calling Tookit.getDefaultToolkit.sync().

      This method is useful in cases where Component.requestFocusInWindow() would fail due to being called too early.

      Parameters:
      target - the component
      limit - the iteration limit; 0 for a default.
    • lastLimitCount

      public static int lastLimitCount()
      Return the number of iterations for SwingOps methods that have an explicit or implied iteration limit. The methods with this property are This method is provided for debugging or testing.
      Returns:
      the number of iterations for the last call to one of these methods; -1 before the first call is made.