路由器网线接口灯不亮:java事件调用系统的计算器?怎么让它在中间显示?

来源:百度文库 编辑:中科新闻网 时间:2024/05/07 09:25:18
java事件调用系统的计算器?怎么让它在中间显示?
Runtime.getRuntime().exec("calc");这个是调用系统的计算器,怎样才能让它在桌面的中间显示哦??急!急!

import java.util.*;

public class TimerDemo {

static Timer tm = new Timer();

public static 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 (Exception ex) {
ex.printStackTrace();
}
tm.cancel();

}

}

public static void main(String[] args) {
tm.schedule(new TimerDemo.MyTimerTask(tm), 3000, 2000);
}
}

就是这样