Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show status problem

Status
Not open for further replies.

kohinoor2007

Programmer
Mar 21, 2007
69
DE
Hi all,

Iam developing a client applet under java.My class extends from JApplet.

Have run into a problem in which the "showstatus" method is not displaying anything on the browser status bar.



My code is as follows:

private void loadInitialData(){

Runnable worker =new Runnable(){

public void run(){

waitUntilConnected();
try{

showStatus("STATUSMESSAGE");
//A Time consuming methid is called from here.TimeConsumingMethod();
showStatus("Ready");


}
catch(Exception error){
showError("Failed,error);

}
}
};

SwingUtilities.invokeLater(worker);

}


"loadInitialData" method is called from the "init" function of the applet. I have some restrictions,for which I have to use the runnable thread.

How can I make the "showstatus" work from within the thread....

Thanks in advance....
 
Looks like you can do it in Eclipse by running it as an applet with the appletviewer.

Cheers,
Dian
 
The invokeLater and invokeAndWait calls are very important in multithreaded Swing applications. Not using them when required can cause things not to work properly with regards to the graphic interface. You do need to unserstand what they do, but then that goes for a lot of Swing in general. It's not trivial.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top