import java.awt.*;
Import the Java. The awt. Event. WindowAdapter;
Import the Java. The awt. Event. WindowEvent;
Public class MygameFrame extends Frame
{
Public void launch ()
{
Enclosing setTitle (" window ");//initialize window
SetVisible (true);//window is visible
SetSize (500500);//window size
SetLocation (400400);//window open position
//add close the window of action
Enclosing addWindowFocusListener (new WindowAdapter ()
{
@ Override
Public void windowClosing (WindowEvent e)
{
System.exit(0);//normal exit program
}
});
}
Public static void main (String [] args)
{
MygameFrame game=new MygameFrame ();
Game. The launch ();
}
}
CodePudding user response:
O bosses give a solutionCodePudding user response:
Has been solved, code wrong, embarrassed,