Jframe exit oon close java11

setVisible(false); //you can't see me!
dispose(); //Destroy the JFrame object
Gamedude