JFrame close window 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: java swing on close
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
updateZonas();
db.close();
}
});