🔒 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
1,016
Guests online
2,931
Total visitors
3,947

Forum statistics

Threads
2,320,266
Posts
29,205,180
Members
1,179,678
Latest member
BossM012
Back
Top