I got this gui which has 2 buttons start and stop server When I press start the server needs to start running and if i close the GUI it should have no effect on the running of the server the server will only be stopped if i open the gui and press stop server What is the best way to do so? I was thinking about creating a new console application, but i have no idea how to do so while running a program.
This is what i tried:
@Override
public void widgetSelected(SelectionEvent arg0) {
Runtime runTime = Runtime.getRuntime();
try {
Process process = runTime.exec("java -classpath .\\bin Server.RunServer");
} catch (IOException e) {
e.printStackTrace();
}