Hi all friends, Iam zipping file through my swing interface and showing the progress of zipping on ProgressMonitor.Iam selecting file by opening FileDialog box on the action event of button,Now my problem is when iam selecting file from my hard disk through FileDialog box for zip, my whole swing interface and ProgressMonitor going to disable and after completion of zipping both are enable.Can any one plz guide me how I can slove this problem.Below r my codes.
Regards Bikash [ July 03, 2003: Message edited by: Bikash Paul ] [ July 03, 2003: Message edited by: Carl Trusiak ]
Look into running your zip process on another thread. You'd have to move the code to a new class that is runnable (better encapsulation is a free benefit) and start it. Then your zip class can call SwingUtilities.invokeLater() or invokeAndWait() with progress updates. These accept yet another runnable object, and run the object back on the original Swing thread. All this allows the Swing thread to accept mouse gestures and keystrokes or update visual goodies like your progress bar while your zip is running. Hope that helps!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi