static A onWindowDeiconified(A w, Runnable r) { if (w != null && r != null) swing { w.addWindowListener(new WindowAdapter { public void windowDeiconified(WindowEvent e) { pcall { r.run(); } } }); } ret w; }