Progress Bar to fast to show
how to slow things down to let the progress bar to show its progress?
here is my codes:
jProgressBar1.setValue(1);
Properties props = System.getProperties();
props.put("mail.smtp.host", "192.168.49.2");
props.put("mail.smtp.auth", "true");
Authenticator pa = new Authenticator (){
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("bbc", "bbc");
}
};
Session session = Session.getDefaultInstance(props, pa);
jProgressBar1.setValue(15);
try{
SMTPTransport t = (SMTPTransport)session.getTransport("smtp");
jProgressBar1.setValue(31);
MimeMessage msg1 = new MimeMessage(session);
InternetAddress sendAddr = new InternetAddress("EY@cgram.com");
sendAddr.setPersonal("Eryan Yu Testing");
msg1.setFrom(sendAddr);
InternetAddress[] address = {new InternetAddress("ey@cgram.com")};
msg1.setRecipients(javax.mail.Message.RecipientType.TO, address);
msg1.setSubject("testing");
msg1.setText("smtp hello");
jProgressBar1.setValue(41);
msg1.setSentDate(new Date());
// send the message
t.connect("192.168.49.2", "ey", "ey");
jProgressBar1.setValue(61);
t.send(msg1);
jProgressBar1.setValue(100);
System.out.println(t.isConnected());
}catch (Exception e){System.out.println(e);}
thanks

