public void setSnuPoolDialog(final JFrame dialog, final SnuPool pool) {
   snuPool = pool;
   pool.putClientProperty("dialog", dialog);
   dialog.addWindowListener(
       new WindowAdapter() {
         @Override
         public void windowClosed(WindowEvent event) {
           pool.putClientProperty("dialog", null);
           if (pool == snuPool) {
             snuPool = null;
           }
         }
       });
 }
 public JFrame getSnuPoolDialog() {
   if (snuPool == null) return null;
   return (JFrame) snuPool.getClientProperty("dialog");
 }