Ver originalthis.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent e) { this.hide(); newFrame.setVisible(true); } public void windowClosing(WindowEvent we) { this.hide(); newFrame.setVisible(true); } });