| 89 | public static void main(String[] args) { |
| 90 | KeyboardFocusManager.setCurrentKeyboardFocusManager(new DefaultKeyboardFocusManager() { |
| 91 | @Override |
| 92 | public boolean dispatchEvent(AWTEvent e) { |
| 93 | if (allowEventInfo && e.getID() != MouseEvent.MOUSE_MOVED) { |
| 94 | if (e.getID() == MouseEvent.MOUSE_PRESSED) { // |
| 95 | if(logging)System.out.println("FocusMan mousepressed event"); |
| 96 | } |
| 97 | if(logging)System.out.println("FocusMan dispatching activeElement=" + (/** @j2sNative document.activeElement.id || */getFocusOwner())); |
| 98 | if(logging)System.out.println("FocusMan dispatching event Source " + e.getSource()); |
| 99 | if (e.toString().indexOf("WINDOW_OPENED")>=0) { |
| 100 | if(logging)System.out.println("???"); |
| 101 | } |
| 102 | // if (e.toString().indexOf("GAINED") >= 0) |
| 103 | if(logging)System.out.println("FocusMan dispatching event " + e); |
| 104 | } |
| 105 | return super.dispatchEvent(e); |
| 106 | } |
| 107 | }); |
| 108 | new Test_Event(); |
| 109 | } |