I just created a GUI program for shutdown PC.
It works fine, so I make a jar file of it which also works.
Now I created an .exe file of it by using exe4j and lauch4j. It will start but when I click on shutdown button nothing happens, .exe program does not work.
It irritates me, because no error message comes.
Here is a code.
public void actionPerformed(ActionEvent e){
String str=e.getActionCommand();
if(e.getSource()==b1) {
try {
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("shutdown -s -t 0");
System.exit(0);
} catch(IOException e2) {
e2.printStackTrace();
}
}
}