2011-10-04 50 views

回答

1

如果要更新該屏幕像這樣寫哪個畫面:

public LoadingScreen()//This is constructor 
{ 
     createGUI(); 
     callingThread(); 
} 
public void createGUI() 
{ 
     //write the all code here; 
} 
public void callingThread() 
{ 
     Thread thread=new Thread() 
     { 
      Thread.sleep(3000); 
      deleteAll(); 
      invalidate(); 
      createGUI(); 
     } 
     thread.start(); 
} 

這樣你就可以刷新屏幕。這裏「invalidate()」刷新屏幕並且createGui()再次將內容添加到屏幕上;