Hi there
I'm writing a java application where I require to run a process in background throughout the lifetime of the running application.
Here's what I have:
Runtime.getRuntime().exec("..(this works ok)..");
Process p = Runtime.getRuntime().exec("..(this works ok)..");
InputStream is = p.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
So, basically I print out every br.readLine()
.
The thing that I'm not sure about is how to implement this code in my application because wherever I put it (with Runnable), it blocks other code from running (as expected).
I've used Runnable, Thread, SwingUtilities, and nothing works...
Any help would be greatly appreciated :)