可能重複:
Is there a way to the hide win32 launch console from a Java program (if possible without JNI)斷開的Java應用程序
當我運行在Windows上的批處理文件,我的Java Swing應用程序,控制檯/命令窗口保持,同時打開我的Java應用程序正在運行。這會在我的任務欄上創建一個額外的窗口,我不希望這樣。但是當我關閉命令窗口時,它會停止我的Java應用程序。有沒有辦法,可能通過批處理文件或命令行參數或代碼更改到我的應用程序,讓我的應用程序仍然運行時啓動我的swing應用程序和控制檯窗口關閉後退出java.exe?
主要方法如下:
public static void main(String args[]) {
ApplContext applContext = new ApplContext();
Throwable error = null;
try {
applContext.setUserConfigDir(args.length>0 ? args[0] : null);
applContext.loadData();
ApplTools.initLookAndFeel(Parameters.P_NIMBUS_LAF.of(applContext.getParameters()));
} catch (Throwable e) {
error = e;
}
// JWorkSheet is a JFrame.
new JWorkSheet(applContext, error).setVisible();
}
我們可以看看你的代碼片段嗎?優選的主要方法。 – jjnguy 2009-10-01 00:45:41
此外,檢查了這一點:http://stackoverflow.com/questions/649634/how-do-i-run-a-bat-file-in-the-background-from-another-bat-file – daveb 2009-10-01 00:55:55
這是一個這個問題的重複:http://stackoverflow.com/questions/264687/is-there-a-way-to-the-hide-win32-launch-console-from-a-java-program-if-possible – 2009-10-01 01:12:25