🔒 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
485
Guests online
3,088
Total visitors
3,573

Forum statistics

Threads
2,305,970
Posts
29,168,832
Members
1,195,530
Latest member
grinchx8
Back
Top