UiBinder中的gwt pushButton [英] gwt pushButton in UiBinder

查看:85
本文介绍了UiBinder中的gwt pushButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用 UiBinder gwt 中创建一个pushButton(所以它是一个带图片的按钮),但是我我不知道如何继续。这是我的 ui.xml 代码:

I need to create a pushButton(so it's a button with image) in gwt with UiBinder, but I'm not sure how proceed. Here is my ui.xml code:


<g:PushButton ui:field="myPushButton"/>

在* .java文件中,我定义了:
PushButton myPushButton; code>

And in *.java file I defined:
PushButton myPushButton;

如何将图像添加到按钮?我尝试了以下方法,但无效:

How can I add an image to the push button? I've tried the following but won't work:


<g:PushButton ui:field="myPushButton" image="myImage.gif" />

谢谢

Thanks

推荐答案

使用下面的代码直接从CustomButton Javadoc:

You can use following code straight from CustomButton Javadoc:

g:PushButton ui:field='pushButton' enabled='true'>
   <g:upFace>
     <b>click me</b>
   </g:upFace>
   <g:upHoveringFace>
     <b>Click ME!</b>
   </g:upHoveringFace>

   <g:downFace image='{downButton}'/>
   <g:downHoveringFace image='{downButton}'/>
 </g:PushButton>

JavaDoc中有更多: http://google-web-toolkit.googlecode.com/svn/javadoc/2.1 /com/google/gwt/user/client/ui/CustomButton.html

There's more in JavaDoc: http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/user/client/ui/CustomButton.html

这篇关于UiBinder中的gwt pushButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆