import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import javax.swing.DefaultDesktopManager;
import javax.swing.DesktopManager;
storeLastKnownDimensions("JALVIEW_RSS_WINDOW_", jvnews.getBounds());
}
+ if (dialogExecutor!=null)
+ {
+ dialogExecutor.shutdownNow();
+ }
System.exit(0);
}
}
}
-
+ /**
+ * single thread that handles display of dialogs to user.
+ */
+ ExecutorService dialogExecutor=null;
+
+ /**
+ * add another dialog thread to the queue
+ * @param prompter
+ */
+ public synchronized void addDialogThread(Runnable prompter)
+ {
+ if (dialogExecutor==null)
+ {
+ dialogExecutor = Executors.newSingleThreadExecutor();
+ }
+ dialogExecutor.submit(prompter);
+ }
}