🔒 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,084
Guests online
8,808
Total visitors
9,892

Forum statistics

Threads
2,341,907
Posts
29,325,467
Members
1,112,929
Latest member
Kyle2006
Back
Top