java界面编程问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:47:40
界面上有按钮,点击按钮可以打开一个应用程序,比如计算器。记事本之类的程序,请问怎么实现?

把下面写在按钮事件监听类里边:

Runtime r=Runtime.getRuntime();
try
{
r.exec("c:\\winnt\\system32\\calc.exe");

}
catch(Exception ee)
{
ee.printStackTrace();
}