I have a program here with buttons. one is a pause button and the other is a resume button. when i click on the pause button the program stops, but when i attempt to click the resume button nothing happens, i can't even click the button or even X out the window. And the click effects on the buttons also dont work. So i'm assuming the program just froze for some reason
public void createButtons() {
fastForwardButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
synchronized(this) {
this.notify();
}
}
});
stopButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
synchronized(this) {
try {
this.wait();
} catch (InterruptedException e3) {
e3.printStackTrace();
}
}
}
});
}
public static void main(String args[]) {
new Sim().start();
}
Any ideas would be much appreciated, thanks
Update: The purpose of this program is to have a simulation of a game and i have these 2 buttons were u can pause the game and then resume the game. but all in all, i really just want to pause the whole program and resume it