gpt4 book ai didi

java - GWT PopupPanel 未正确显示动画图像

转载 作者:行者123 更新时间:2023-12-01 13:30:17 24 4
gpt4 key购买 nike

我有一种方法,在屏幕加载和服务器工作负载时使用 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 Drive 并使用共享 url 作为要使用的 url,但到目前为止我还没有成功。

谁能告诉我?

谢谢。

最佳答案

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

progress.gif应该在Resources类的同一个文件夹中(也可以使用相对路径-更改@source值)

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





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

关于java - GWT PopupPanel 未正确显示动画图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21608891/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com