JFrame.DO_NOTHING_ON_CLOSE
JFrame.setDefaultCloseOperation methods take different variables, and JFrame DO_NOTHING_ON_CLOSE is one of them.Others are
JFrame.DO_NOTHING_ON_CLOSE Example
[
import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JButton; import java.awt.Dimension; public class JFrameMethods extends JPanel{ public JFrameMethods() { JTextArea area=new JTextArea(200,200); area.setBounds(10,10,200,200); add(area); } public static void main(String args[]) { JFrame frame=new JFrame(); frame.getContentPane().add(new JFrameMethods()); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setSize(new Dimension(300,300)); frame.setVisible(true); } }
]