How to use buttons on the Java program interface to start the external EXE program

xiaoxiao2021-03-06  80

In Java, executing external procedures can be used using Runtime.Getruntime (). EXEC ("The program name to run") is OK.

Class Runapp {

Public static void main (string args []) {

Try {

Process P = runtime.getRuntime (). EXEC ("NOTEPAD.EXE");

// Execute a writing board under Windows

p.WaitFor ();

}

Catch (Exception E) {system.out.println (E.getMessage ());}

}

}

-------------------------------------------------- -------------------------------------

Transfer from 9CBS Java FAQ

转载请注明原文地址:https://www.9cbs.com/read-106229.html

New Post(0)