Execute only one instance of SwingWorker
问题 Suppose I have a Java GUI which shows in a panel 40 Batch objects from a selected zone which can go from A to Z. The 40 Batch objects are queried from database which caches them by zone so that each request for a zone doesn't involve the database every time. public class BatchView { private int drawIt(Graphics g, String zone) { for(int i = 0; i<40; i++) { Batch tmpBatch = BatchDAO.getBatch(zone, i); //draw the tmpBatch object } } } public class BatchDAO { public static MyCache cache = new