• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Query on zipping of file??

 
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 ]
 
(instanceof Sidekick)
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
 
No holds barred. And no bars holed. Except this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic