代码如下
import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.Timer; public class Java_2 { public static void main(String[] args) { //*********Found********** ActionListener listener = new __________________(); Timer t = new Timer(10000, listener); t.start(); JOptionPane.showMessageDialog(null, "退出程序吗?"); System.exit(0); } } //*********Found********** class TimePrinter ___________________ ActionListener{ //*********Found********** public void actionPerformed(___________________ event) { Date now = new Date(); System.out.println("At the tone, the time is " + now); //*********Found********** ___________________.getDefaultToolkit().beep(); } }