Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将图像添加为托管资源(Ui绑定器)时出错_Java_Gwt_Uibinder - Fatal编程技术网

Java 将图像添加为托管资源(Ui绑定器)时出错

Java 将图像添加为托管资源(Ui绑定器)时出错,java,gwt,uibinder,Java,Gwt,Uibinder,我试图在UiBinder Gwt中添加一个映像作为托管资源,但在“元素my only contain one child Element”行中出现错误 如何修改代码以克服错误 这是我的xml文件 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> 不能将外部ClientBundle中定义的ui:style和ImageResource混合使用。要在ui:style中使用@sprite,必须使用u

我试图在UiBinder Gwt中添加一个映像作为托管资源,但在“元素my only contain one child Element”行中出现错误

如何修改代码以克服错误

这是我的xml文件

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">

不能将外部
ClientBundle
中定义的
ui:style
ImageResource
混合使用。要在
ui:style
中使用
@sprite
,必须使用
ui:image
元素定义
ImageResource

<ui:image field="requiredImage" src="images/required_indicator.gif" />


问题是,如果我像这样添加图像,它会在页面上出现两次。我只希望图像在网格中出现一次。是否有方法添加图像,以便我可以将其视为网格中的第二列,然后向其添加功能?
public interface myResources extends ClientBundle{
    @Source ("images/required_indicator.gif")
    ImageResource requiredImage();
<ui:image field="requiredImage" src="images/required_indicator.gif" />