M
misbah.mubarak
I want to run a java program using a button on the GUI. I have used
the following code
try{
System.out.println("Inside execution");
Runtime.getRuntime().exec("cmd.exe");
System.out.println(command);
process= new ProcessBuilder(command);
process.start();
}
catch(Exception except)
{
except.printStackTrace();
}
The purpose is to launch a separate execution window a part from the
cmd.exe thats open through the GUI. When I did this using process
builder,the output would come but not in a separate execution window.
Moreover, the output was not complete and the println statements were
not getting displayed.
the following code
try{
System.out.println("Inside execution");
Runtime.getRuntime().exec("cmd.exe");
System.out.println(command);
process= new ProcessBuilder(command);
process.start();
}
catch(Exception except)
{
except.printStackTrace();
}
The purpose is to launch a separate execution window a part from the
cmd.exe thats open through the GUI. When I did this using process
builder,the output would come but not in a separate execution window.
Moreover, the output was not complete and the println statements were
not getting displayed.