private boolean openEditDialog(int id) { this.setEnabled(false); EditCustomerFrame cf = new EditCustomerFrame(id, store); cf.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { // refresh table textFieldSearch_actionPerformed(null); super.setEnabled(true); } public void windowClosed(WindowEvent e) { windowClosing(null); } }); return true; }