• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ProgressMonitor problem

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a use case in which I want to display a progress bar indicating the downloaded number of bytes. I decided to go for ProgressMonitor since it gives me options to cancel the download, and also to periodically display the bytes downloaded.

But I read in the java doc of ProgressMonitor that the progress bar doesnt always show up. I tried setting setMillisToPopup(0) and also setMillisToDecideToPopup(0). Currently, I am seeing that if the download does not take a long time, then the progress bar doesnt show up, inspite of setting both setMillisToDecideToPopup and setMillisToPopup to 0 milliseconds. Is this expected behavior?

Also, is this a right use case to use ProgressMonitor? Can someone please guide me in this?


Thanks in advance,
Preethi
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a threading problem to me. Without seeing your code, it is not possible to figure out what the problem is.
Does the progress bar and download operation happen on the same thread?
Have you looked at http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No actually, the downloading part is a 3rd party API which I am trying to use in my code. I just needed to attach a progress bar in my code to indicate the download progress. Is my approach wrong?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you go through the link I had provided to figure out how to fix the threading issue?
 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I did... actually, I have a constraint of using java 5.0 only... and the link seems to talk about threads with respect to progress bars only, and not progress monitor, so, I guess I am on wrong track.
 
reply
    Bookmark Topic Watch Topic
  • New Topic