-1

I'm trying develop a Java application for sending email. I'm using Java mail. I want to add file attachment option for this application. I did it. But now I need to add a jProgressBar to this application for viewing attachment uploading progress. I haven't idea about adding a jPogressBar to viewing uploading progress.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • 1
    Take a look at [JProgressBar documentation](http://docs.oracle.com/javase/7/docs/api/javax/swing/JProgressBar.html) and in [this usage example](http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html). Please add some code snippets to your post so we can see what you've done so far and where, exactly, your question is. – Bruno Toffolo Jan 29 '14 at 15:00
  • 1
    Please learn about `SwingWorker` and how to handle background tasks progress – Keerthivasan Jan 29 '14 at 15:01

1 Answers1

0

If you have a Java application using Swing and JavaMail, and you want a progress bar when the message is being sent to the mail server, that's difficult. There's nothing that will tell you how much of the message (or the file attachment part of the message) has been sent to the mail server. You can have a progress bar that say "I'm working", but you can't (easily) have a progress bar that says "N% done".

If you have a Java application running in a server, and you're uploading the file attachment from the browser, and you want a progress dialog while the file upload is running, you can probably do that using JavaScript in the browser.

Bill Shannon
  • 29,579
  • 6
  • 38
  • 40