English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

ok, i am creating an APPLICATION (not javascript or w/e) to launch an external application when someone presses a button. i have everything else except the actual launching part. i know in VB is like Shell ("C:whatever") but what is it in java and what classes would i need to import?? thanks!

2007-02-13 07:51:38 · 2 answers · asked by DarkAardvark 2 in Computers & Internet Programming & Design

2 answers

Look at the Runtime class (java.lang.Runtime). If you are launching an application with an executable (example: notepad.exe), then it is simple:

Runtime.getRuntime().exec("notepad.exe sample.txt");

If you need to get additional info on the new sub-process (wait for termination, get exit value, etc.), the exec() methods return a Process object. Take a look at the javadocs.

2007-02-13 19:46:19 · answer #1 · answered by vincentgl 5 · 0 0

the version between Java and Javascript ought to no longer be signified by skill of mere examples of syntactical alterations. Java is a programming language, and hence a application written in Java would nicely be compiled. With Java you could create stand-on my own application, applets, and servlets. Javascript is a scripting language, and hence would not opt for a compiler, yet extremely an interpreter. Javascript runs through potential of a browser and isn't any longer from now on used to create stand-on my own courses. those aspects aren't from now on even the properly of the iceburg, yet they do provide a short evaluation of the numerous major distinction. Java would not be used to create a dynamic information superhighway web site alongside HTML, CSS or perhaps if else you employ; it extremely is the purpose of Javascript. in spite of the straightforward undeniable reality that, in case you had to have some animation, pastime, or company company application as component of your information superhighway web site, then a Java applet ought to do the trick. the in trouble-free words problem that I see with Java applets today, is that Flash and Silverlight run plenty speedier interior the browser.

2016-11-27 20:50:31 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers