2014-02-06 44 views
0

我有一種方法,在屏幕加載和服務器工作負載時,我使用gwt PopupPanel顯示圖像。GWT PopupPanel沒有正確顯示動畫圖像

final static PopupPanel popup = new PopupPanel(false, true); 

我使用的方法是:

public static void sBanner() { 

     popup.setWidget(new Image("Images//Progress.gif")); 
     popup.setGlassEnabled(true); 
     popup.center(); 
    } 

什麼我不設法做到這一點是顯示圖像的方法的調用時。

在當地,運行良好;但是當我將代碼部署到Google App Engine時,我得到了像Google App Engine這樣的圖標,並未找到引用的文件。

我也嘗試將圖片上傳到Google雲端硬盤並使用共享網址作爲網址使用,但到目前爲止我還沒有成功。

任何人都可以照亮我嗎?

謝謝。

回答

1

使用com.google.gwt.resources.client.ImageResource提供圖像。

progress.gif應在資源類的同一個文件夾(相對路徑也可以用來改變@source值)

public interface Resources extends ClientBundle { 
       @Source("progress.gif") 
       ImageResource getPreloader(); 
      } 





Resources resources = GWT.create(Resources.class); 
popup.setWidget(new Image(resources.getPreloader())); 
+0

謝謝你的迴應:-)。我會實施它,看看它是如何發展的。 – Catersa