import java.awt.event.*;
import javax.swing.*;//N o w J a v a . c o m - 时代Java 提 供
public class TickTockInner
{
private static String tickMessage = "Tick...";
private static String tockMessage = "Tock...";
public static void main(String[] args)
{
TickTockInner t = new TickTockInner();
t.go();
}
private void go()
{
Timer t = new Timer(1000, new Ticker());
t.start();
/** 来 自 时代Java - nowjava.com**/
JOptionPane.showMessageDialog(null,
"Click OK to exit program");
System.exit(0);
}
static class Ticker implements ActionListener
{
private boolean tick = true;
public void actionPerformed(ActionEvent event)
{
if (tick)
{
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。