As Bob barker used to say on truth or Consequences when someone actually
answered the riddle, there's a second part o this question:
This hack works but it allows multiple instances of the special
characters palette to run simultaneously. How do we find out if this
process is already running, so we only launch it if it isn't already
running? This one I figured out. You have to exec a "ps -awwx" (Yes, you
have to use w twice.) and look for the command:
public void actionPerformed(ActionEvent evt) {
try {
Process process = Runtime.getRuntime().exec("ps -awwx");
InputStream in = new
BufferedInputStream(process.getInputStream());
BufferedReader reader = new BufferedReader(new
InputStreamReader(in));
String s = null;
while ((s = reader.readLine()) != null) {
if (s.indexOf(command) != -1) return;
}
Runtime.getRuntime().exec(command);
}
catch (Exception ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}