javamail

E

Emmanuel Freund

Does anyone know a way to implement a progress bar with javamail?
I would like to show the estimated time for receiving e-mails with a big
attachment (a 3MO picture for example)?
Thanks for any idea.
 
N

Neil Campbell

Emmanuel said:
Does anyone know a way to implement a progress bar with javamail?
I would like to show the estimated time for receiving e-mails with a big
attachment (a 3MO picture for example)?
Thanks for any idea.

Do you mean a graphical progress bar, in Swing for example, or a text based
one in a console? Either way, I'd say that it isn't really a Javamail
problem. You just have to set up your progress bar in the normal way, and
tell it how far along the task is. I think there's a tutorial for Swing
progress bars, and a text based one is fairly easy to implement.

You can determine the size of an attachment in Javamail with the getSize()
method in the Part class. Then, as you read the data from the input stream
you can work out how much more there is to do and update the progress bar
accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top