hii every one I want to show progress bar while my program sends email
how can i do it?
hii every one I want to show progress bar while my program sends email
how can i do it?
Display a simple gif image with hourglass or striped loading bar or something similar. Since this will be a single step operation you can't actually tell the user N % complete. Add a callback with timeout to verify the success of the operation. How you display the image depends on what technology you are using.
depending on native/webapp, single email/multiple emails, solutions might be slightly different.
e.g webapp+single email, consider a animated gif, while you do send the email in another iframe.
e.g. webapp+multiple email, a progress bar can continuously display the percentage done, based on a number of sent emails/total emails, after each email get sent.
Swing's JProgressBar is probably your best bet for an applet.
It has a mode for when you don't know how long an operation will take.
For JavaMail you can listen to the transport system (probably com.sun.mail.smtp.SMTPTransport) with a TransportListener which will tell you when each message has been sent at least, so you can do progress for multiple recipients.
You need to put together two classes, JProgressBar for the UI, and SwingWorker for the background thread. From your comments, it looks like you first need to be looking at a SwingWorker tutorial.