Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLabel does not show information

 
D. Formenton
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have the following code:

private void riceviMouseClicked(java.awt.event.MouseEvent evt) {
mp = new MailParser();
ArrayList messages;
lblStatus.setText("Inizializzazione");
messages = receiveMail(opzioni.getPopServer().getValore(),
opzioni.getEmailUser().getValore(),
opzioni.getEmailPassword().getValore());
mp.parseAndStore(messages);
}

All run OK, BUT the text "Inizializzazione" appears only when the process (of receiving mails) terminated!

Why the sequence: "before write label, after receive mail" is not respected?

What I have to do to write the label (and show it, obviously!) before the process receiveMail starts?

Thank you to all and Merry Christmas!

Domenico


 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Concurrency in Swing
 
PrasannaKumar Sathiyanantham
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the swing runs as a thread. So whatever changes you have it will respond only when the thread is invoked again. Just try swingutilities in google and you will get good examples regrading it.(what i suggested may seem vague but type it in google and read ,you will understand better)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic