🔒 Closed Restart button or restart key

Status
Not open for further replies.
boss gising ka ?
paano maclose yung old program kasi once nag spacebar ako mag rrun ulit yung file pero naiiwang bukas yung naunang file
Initialize mo yung jframe sa labas para madispose sa Restart function.
Taos dispose mo, then setvisible mo again.
Code:
public static void Restart()
    {
        ex.setVisible(false);
        ex.dispose();
        EventQueue.invokeLater(() -> {
           ex = new Snake();
           ex.setVisible(true);
        });
    }
 
Initialize mo yung jframe sa labas para madispose sa Restart function.
Taos dispose mo, then setvisible mo again.
Code:
public static void Restart()
    {
        ex.setVisible(false);
        ex.dispose();
        EventQueue.invokeLater(() -> {
           ex = new Snake();
           ex.setVisible(true);
        });
    }

wait boss analyze ko lang to code mo ^_^ thanks po
 
Status
Not open for further replies.

About this Thread

  • 28
    Replies
  • 1K
    Views
  • 3
    Participants
Last reply from:
PHC-B L 4 C K

Trending Topics

Online now

Members online
351
Guests online
6,855
Total visitors
7,206

Forum statistics

Threads
2,354,789
Posts
29,385,047
Members
1,079,625
Latest member
miph135
Back
Top