@Override public void focusLost(FocusEvent event) { if (in instanceof FocusListener) { ((FocusListener) in).focusLost(event); } if (claimSystemOutErr && VmSystem.hasVmIOContext()) { myIsolate.invokeAndWait( new Runnable() { public void run() { savedOut = System.out; savedErr = System.err; } }); } super.focusLost(event); }
@Override public void focusGained(FocusEvent event) { super.focusGained(event); syncScreen(0, screen.getWidth() * screen.getHeight()); if (in instanceof FocusListener) { ((FocusListener) in).focusGained(event); } if (claimSystemOutErr && VmSystem.hasVmIOContext()) { myIsolate.invokeAndWait( new Runnable() { public void run() { AccessController.doPrivileged( new PrivilegedAction<Object>() { public Object run() { System.setOut(savedOut); System.setErr(savedErr); return null; } }); } }); } }