In a swing application, when ok button is clicked, i want to new a class ScanCard (implements ScannerListener and PropertyChangeListener), and I want to wait till ScanCard is finished then doAction(), if like the code showed, the doAction() is performed before or during ScanCard runing, what should I do to achieve the purpose?
Censorship is the younger of two shameful sisters, the older one bears the name inquisition. -- Johann Nepomuk Nestroy
Joined: Apr 10, 2009
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.