📄 调用外部程序.java
字号:
*
* @(#)First.java 1.0 03/11/13
*
* You can modify the template of this file in the
* directory ..\JCreator\Templates\Template_1\Project_Name.java
*
* You can also create your own project template by making a new
* folder in the directory ..\JCreator\Template\. Use the other
* templates as examples.
* 调用外部程序
*/
package myprojects.first;
import java.awt.*;
import java.awt.event.*;
class First extends Frame {
public First() {
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
}
public static void main(String args[]) throws Exception{
System.out.println("Starting First...");
First mainFrame = new First();
mainFrame.setSize(400, 400);
mainFrame.setTitle("First");
mainFrame.setVisible(true);
String prefix=System.getProperty("user.dir")+System.getProperty("file.separator");
System.out.println(prefix);
String prefix2=System.getProperty("user.dir");
System.out.println(prefix2);
Runtime.getRuntime().exec("notepad.exe");
Process proc = Runtime.getRuntime().exec( "cmd /E:ON /c start winword.exe");
Runtime.getRuntime().exec("f:\\delphi网络程序\\chap3\\FTP-API\\FTP.exe");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -