Article View: borland.public.jbuilder.java.swing
Article #10429Refreshing Problem and Thread ????
From: Michel P�rez
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
49 lines
2254 bytes
2254 bytes
Hey !
Hello World !
I'm here again with a diferent and serius problem.
I have a main class where there is a JLabel component that act like a
StatusBar, I need refresh it constantly I hava a method called refresh where
i do the following, and i called at any moment that I'm doing a process and
I need to sent information to the user in order to show that the application
is processing :
public void setMessage(String message)
{
jLabStatusBar.setText("");
jLabStatusBar.setText("Status Bar: " + message);
jLabStatusBar.revalidate();
jLabStatusBar.repaint();
}
but this method doesn't work because the application is busy procesing other
things with a high priority, for example start up the conexion to a
EnterPrise Java Bean Server, however I called my setMessage() method in the
middle of the method connection(), but doesn't refresh. I think the vm
doesn't take care of repaint the components because there are things more
heavier and important than this.
How could I fixed this ?
I have tried even a thread in my application, my class implement runnable
and my method run is :
public void run (){
Thread myThread = Thread.currentThread();
while (mThread == myThread) {
try {
refresh();
System.out.println("Executing Thread...");
Thread.sleep(500);
} catch (InterruptedException e){
}
}
}
I don't know what other thing to do.
I need that my JLabel component set the text that i sent is the exact moment
that this component recive the text, and repaint at any moment and no
repaint when vm has finish other process.
Thank you very much
Technical Details
Message-ID:
<7so3i2$d4n9@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,688133ee834ee9f1,start X-Google-Attributes: gid111d45,public From: "Michel P�rez" <mperez@eurobanco.com> Subject: Refreshing Problem and Thread ???? Date: 1999/09/27 Message-ID: <7so3i2$d4n9@forums.borland.com> X-Deja-AN: 529909719 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing