6833019: KeyboardFocusManager.getCurrentKeyboardFocusManager() throws unspecified HeadlessException
authorant
Thu, 21 May 2009 15:04:23 +0400
changeset 2809 b373581f6507
parent 2808 a139a919f645
child 2810 fa49c6a06baf
6833019: KeyboardFocusManager.getCurrentKeyboardFocusManager() throws unspecified HeadlessException Reviewed-by: art
jdk/src/share/classes/sun/awt/HeadlessToolkit.java
--- a/jdk/src/share/classes/sun/awt/HeadlessToolkit.java	Thu May 21 12:29:25 2009 +0400
+++ b/jdk/src/share/classes/sun/awt/HeadlessToolkit.java	Thu May 21 15:04:23 2009 +0400
@@ -179,9 +179,15 @@
         throw new HeadlessException();
     }
 
-    public  KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager)
-        throws HeadlessException {
-        throw new HeadlessException();
+    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+        // See 6833019.
+        return
+            new KeyboardFocusManagerPeer() {
+                public Window getCurrentFocusedWindow() { return null; }
+                public void setCurrentFocusOwner(Component comp) {}
+                public Component getCurrentFocusOwner() { return null; }
+                public void clearGlobalFocusOwner(Window activeWindow) {}
+            };
     }
 
     public TrayIconPeer createTrayIcon(TrayIcon target)