?? timertest.java.bak
字號:
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
//to resolve conflict with java.util.Timer
public class TimerTest
{
public static void main(String [] args)
{
ActionListener listener=new TimerPrinter();
//construct a timer that calls the listener
//once every 10 seconds
Timer t=new Timer(100,listener);
t.start();
JOptionPane.showMessageDialog(null,"Quit program?");
System.exit(0);
}
}
class TimerPrinter implements ActionListener
{
public void actionPerformed(ActionEvent Event)
{Date now=new Date();
System.out.println("At the tone,the time is"+now);
Toolkit.getDefaultToolkit().beep();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -