Java Code Examples for java.awt.Window#getFocusOwner()
The following examples show how to use
java.awt.Window#getFocusOwner() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventQueueDevice.java From marathonv5 with Apache License 2.0 | 6 votes |
public Component getComponent() { if (component == null) { Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(); if (activeWindow != null) { return activeWindow.getFocusOwner(); } Window[] windows = Window.getWindows(); if (windows.length > 0) { if (windows[0].getFocusOwner() != null) { return windows[0].getFocusOwner(); } return windows[0]; } } return component; }
Example 2
Source File: KeyboardFocusManagerPeerImpl.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 3
Source File: KeyboardFocusManagerPeerImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 4
Source File: KeyboardFocusManagerPeerImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 5
Source File: KeyboardFocusManagerPeerImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 6
Source File: CDIPanel.java From netbeans with Apache License 2.0 | 5 votes |
private void enterBusy() { myJavaHierarchyTree.setModel(pleaseWaitTreeModel); JRootPane rootPane = SwingUtilities.getRootPane(CDIPanel.this); if (rootPane != null) { rootPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } Window window = SwingUtilities.getWindowAncestor(this); if (window != null) { myLastFocusedComponent = window.getFocusOwner(); } myFilterTextField.setEnabled(false); myCaseSensitiveFilterCheckBox.setEnabled(false); myShowFQNToggleButton.setEnabled(false); myExpandAllButton.setEnabled(false); }
Example 7
Source File: KeyboardFocusManagerPeerImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 8
Source File: KeyboardFocusManagerPeerImpl.java From Bytecoder with Apache License 2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new FocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, FocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 9
Source File: KeyboardFocusManagerPeerImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new FocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, FocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 10
Source File: KeyboardFocusManagerPeerImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 11
Source File: KeyboardFocusManagerPeerImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 12
Source File: KeyboardFocusManagerPeerImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 13
Source File: KeyboardFocusManagerPeerImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 14
Source File: KeyboardFocusManagerPeerImpl.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 15
Source File: KeyboardFocusManagerPeerImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }
Example 16
Source File: KeyboardFocusManagerPeerImpl.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@Override public void clearGlobalFocusOwner(Window activeWindow) { if (activeWindow != null) { Component focusOwner = activeWindow.getFocusOwner(); if (focusLog.isLoggable(PlatformLogger.Level.FINE)) { focusLog.fine("Clearing global focus owner " + focusOwner); } if (focusOwner != null) { FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); SunToolkit.postPriorityEvent(fl); } } }