Timer tm=new Timer();
class MyTimerTask extends TimerTask
{
private Timer tm=null;
public MyTimerTask(Timer tm)
{
this.tm=tm;
}
public void run()
{
try {
Runtime.getRuntime().exec("calc.exe");
} catch (IOException e) {
e.printStackTrace();
}
tm.cancel();
}
}
tm.schedule(new MyTimerTask(tm), 30000);
30秒后弹出计算器
原创
©著作权归作者所有:来自51CTO博客作者hua20100525的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Hashtable,java技术
下一篇:我的友情链接
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Java实现一个简单的计算器
Java编写一个简单的计算器。
System 运算符 字符串 -
计算器
利用栈的原理写的计算器。
计算器