void (JComponent c) { myWatcher = createWatcher(); myWatcher.register(c); UserActivityListener userActivityListener = new UserActivityListener() { @Override public void stateChanged() { fireEditorStateChanged(); } }; myWatcher.addUserActivityListener(userActivityListener, this); }