I am building a system where there is a simple GUI which will trigger the system to execute. I implemented the system in a way that when an exception is thrown, System.exit(0)
is called and so the application stops.
I would like the implementation to stop, as it is doing now, however I wish that the GUI would not be closed as well. I tried implementing the system in a separate thread, however when some exception was thrown, the application still closed down.
Is there a way to leave the UI open, but still stop the implementation?