From: BeanShell User <beanshell@co...> - 2004-03-22 19:08:13
I'm trying to do the equivalent of a run() or bg() on an external
application. Specifically, a
java <lotsa arguments>
type of line.
The reason is, currently in my script I make a small GUI and when you press
a button, it collects data entered into the GUI and calls
When I do this though, the GUI freezes while the exec() is doing its thing
(which can take a long while). While frozen, it just shows the depressed
button. I can't do anything else, like allow the user to hit a cancel button
also in the GUI. If another window is open and brought in front of the GUI
(or the GUI is minimized) and then its brought back in front, everything in
the JFrame disappears and it just looks like a blank (grey) window, until
the exec(java..) is done. Thats why I was hoping to be able to put it in the
bg, if possible.
I guess I could put my own threading around it, but I'm hoping not to have
to do that. I was also thinking of using run("some.bsh", java_arg) and have
some.bsh run the exec() for me (with java_arg containing the arguments
extracted from the GUI). I dont even know, though, if the run() will be
enough, and that I wont need a bg(), which according to the docs, wont
accept a second argument.