?? timer1.java
字號:
// (c) Copyright 1997-2001 Recursion Software Inc.
package examples.timer;
import com.recursionsw.lib.timer.*;
public class Timer1
{
public static void main( String args[] )
{
SleepyHead sleepy1 = new SleepyHead();
SleepyHead sleepy2 = new SleepyHead();
System.out.println( "notify after 2 seconds using shared thread" );
Timer timer = new Timer();
timer.addTimerListener( sleepy1 );
timer.addTimerListener( sleepy2 );
timer.alarmAfter( 2000 );
System.out.println( "main program sleeps for 10 seconds..." );
try{ Thread.sleep( 10000 ); } catch( InterruptedException exception ) {}
System.out.println( "main program terminates" );
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -