JFrame exit code example
Example 1: how to close a jframe in java with an if statement
Jframe frame = new Jframe();
int count = 0;
if(count==10){
frame.setVisable(false);
frame.dispose();
}
Example 2: jframe exit on close
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Example 3: java exit
System.exit(0);
Example 4: java close jframe
setVisible(false); //you can't see me!
dispose(); //Destroy the JFrame object