public void setPossiblePoolDialog(final JFrame dialog, final ResourceTreeTable pool) { possiblePool = pool; possiblePool.putClientProperty("dialog", dialog); dialog.addWindowListener( new WindowAdapter() { @Override public void windowClosed(WindowEvent event) { pool.putClientProperty("dialog", null); if (pool == possiblePool) { possiblePool = null; } } }); }