• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why the function dose not work?Please tell me what is the matter?

 
Lin tao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.awt.*;
import java.applet.*;
import java.lang.*;
import java.io.*;
public class Excute extends Applet {

public void init(String cmdUrl,String str) {
try {
String[] cmd = {cmdUrl, str};
Runtime.getRuntime().exec(cmd);
}
catch(Exception e) {
System.out.println(e);
}
}
public static void run() {
Excute exe = new Excute();
String cmdUrl = "calc.exe";
String str = "";
try {
exe.init(cmdUrl,str);
}
catch(Exception e) {
System.out.println(e);
}
}
public static void main(String[] args) {
run();
}
public void paint(Graphics g) {}
}
 
Marilyn de Queiroz
Sheriff
Posts: 9068
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which function doesn't work?
 
Lin tao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marilyn de Queiroz:
Which function doesn't work?


run()
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean exactly that it doesn't work? What do you do to try and use it? What should it do? Does it produce any error messages?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic