Sorry for the confusion and thanks for the help. Yeah, that is what I want to do. When ok button is clicked, it (ScanCard) will begin scan a image and draw the image on the main window, user needs to wait during the scan process, after the drawing is finished, ScanCard finished its task and notify the the GUI, then doAction() will do further things. The SwingWorker seems the good choice, but I am using
java 1.5 which do not have SwingWorker. What I should do without SwingWorker.