I import javax.swing.*;
and have a JOptionPane:
String meny = JOptionPane.showInputDialog(null, "What's the answer?").trim();
I want this window to close after the amount of seconds the user inserts:
String time = JOptionPane.showInputDialog(null, "How much time").trim();
int timer1 = Integer.parseInt(time);
I do not know how to do this. Should I do something like this?
if (timer1 == 0) {
meny.setVisible(false);
}
Thanks in advance!