Add 'src/jexer/' from commit 'cf01c92f5809a0732409e280fb0f32f27393618d'
[fanfix.git] / src / jexer / backend / SwingComponent.java
index 57f8fd6b40ee4a508bc907e9d50c4d69510aa853..3d1074cf889070d6bc1c7eee4d9be1da80b92d06 100644 (file)
@@ -586,4 +586,16 @@ class SwingComponent {
         }
     }
 
+    /**
+     * Requests that this Component get the input focus, if this Component's
+     * top-level ancestor is already the focused Window.
+     */
+    public void requestFocusInWindow() {
+        if (frame != null) {
+            frame.requestFocusInWindow();
+        } else {
+            component.requestFocusInWindow();
+        }
+    }
+
 }