Win a copy of Terraform in Action this week in the Cloud forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Query on zipping of file??

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for ur suggestion.
Thanks
Bikash
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic