import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Scanner;
import javax.swing.JOptionPane;
import javax.swing.Timer;
public class TesterCountDown {
public static void main(String[] args) {
// TODO Auto-generated method stub
//classe interna
class CountDown implements ActionListener{
//costruttore
public CountDown (int initialCount) {
count = initialCount;
}
//metodo
public void actionPerformed(ActionEvent event) {
if(count>=0) {
System.out.println(count);
count--;
}
}
//variabile d'istanza
private int count;
}
CountDown capodanno = new CountDown(10);
Timer t = new Timer(1000, capodanno);t.start();
//JOptionPane.showMessageDialog(null, "Quit?");
System.exit(0);
t.stop();
}
}
Mi sapreste spiegare perche se oscuro la JOptionPane non funziona?