changeset 1223:97ece6b3d84f

6833019: KeyboardFocusManager.getCurrentKeyboardFocusManager() throws unspecified HeadlessException Reviewed-by: art
author ant
date Thu, 21 May 2009 15:04:23 +0400
parents b33466bb2fed
children cfe73335a065
files src/share/classes/sun/awt/HeadlessToolkit.java
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/HeadlessToolkit.java	Thu May 21 12:29:25 2009 +0400
+++ b/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)