Results 1 to 7 of 7
Thread: Problem With JProgressBar
- 02-24-2011, 01:05 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 6
- Rep Power
- 0
Problem With JProgressBar
I m having some problem with JProgressBar.. :(
i think their is some thing wrong with my code
on a button click i want my to set my progressbar to indeterminate mode and send a mail. But i can't see any change to the progressbar.
//// code for button click
jProgressBar.setIndeterminate(true);
Pattern splitter = Pattern.compile(",");
String[] ToAddress = splitter.split(jTextPane2.getText());
InternetAddress[] addressTo = new InternetAddress[ToAddress.length];
try {
for (int i = 0; i < ToAddress.length; i++)
{
addressTo[i] = new InternetAddress(ToAddress[i]);
}
message.setFrom(new InternetAddress(AddressFrom));
message.setRecipients(RecipientType.TO, addressTo);
message.setSubject(jTextField1.getText());
message.setText(TextPaneMessage.getText());
Transport.send(message);
} catch (MessagingException el) {
System.out.println(el);
}
System.out.print("done");
jProgressBar.setIndeterminate(false);
- 02-24-2011, 01:33 PM #2
That's because you're doing all of this code on the EDT. The JProgressBar is also updated on the EDT (all of the GUI is). So the JProgressBar won't be updated or repainted until this method exits- and by then, you've deactivated indeterminate mode.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 02-24-2011, 05:25 PM #3
Member
- Join Date
- Feb 2011
- Posts
- 6
- Rep Power
- 0
Thank you very much sir... :)
so should i go for SwingWorker? :)
- 02-24-2011, 05:29 PM #4
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 02-24-2011, 05:40 PM #5
Member
- Join Date
- Feb 2011
- Posts
- 6
- Rep Power
- 0
- 02-24-2011, 06:06 PM #6
Member
- Join Date
- Feb 2011
- Posts
- 6
- Rep Power
- 0
- 02-24-2011, 06:08 PM #7
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Load thread with JProgressBar
By Dennis in forum Advanced JavaReplies: 10Last Post: 10-09-2010, 09:32 AM -
JprogressBar
By cotarelo in forum AWT / SwingReplies: 7Last Post: 03-26-2010, 03:13 AM -
JProgressBar inside a JDialog
By Mikey_S in forum AWT / SwingReplies: 10Last Post: 07-13-2009, 02:55 PM -
Updating a JProgressBar from another thread?
By Xiphias in forum AWT / SwingReplies: 3Last Post: 03-18-2009, 01:48 AM -
Placing a JProgressBar over my JPEG image
By hitmen in forum AWT / SwingReplies: 7Last Post: 03-08-2009, 10:16 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks