6833019: KeyboardFocusManager.getCurrentKeyboardFocusManager() throws unspecified HeadlessException
Reviewed-by: art
--- 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)