• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query on zipping of file??  RSS feed

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for ur suggestion.
Thanks
Bikash
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!