void installActivateListener() { // FIXME: should watch for hierarchy changes Window toplevel = getTopLevel(target); if (toplevel != null) { toplevel.addWindowFocusListener(this); applicationActive = toplevel.isFocused(); } }