相关代码 |
|
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Test implements ActionListener { public Test() { Timer oneSecondTimer = new Timer(1000, this); oneSecondTimer.setInitialDelay(10000); oneSecondTimer.setRepeats(false); oneSecondTimer.start(); } public void actionPerformed(ActionEvent e) { System.out.println("ring ..."); } public static void main(String args[]) { new Test(); while(true); } }
相关资源 |
|