Another vote for the pushbutton, just remember to clear its style, otherwise its default style will be underneath your images. Pushbutton supports mouse-over, mouse-down (in the constructor) and mouse-up (also in the constructor)
-- Jan Vladimir Mostert BEngSci MyCee Technologies On Tue, Apr 5, 2011 at 8:55 AM, Alexandre Ardhuin < alexandre.ardh...@gmail.com> wrote: > Hi, > > You can also use a com.google.gwt.user.client.ui.PushButton that have a > constructor with 2 images as parameter. > > Alexandre. > > > 2011/4/5 Zak Linder <zakn...@gmail.com> > >> Hi Arilene- >> >> You need to set the original image with a MouseOutHandler as well. >> >> >> img_p1.addMouseOverHandler(new MouseOverHandler() { >> >> @Override >> public void onMouseOver(MouseOverEvent event) { >> img_p1.setImage("img", "/icons/grafo.png"); >> } >> }); >> >> img_p1.addMouseOutHandler(new MouseOutHandler() { >> >> @Override >> public void onMouseOut(MouseOutEvent event) { >> img_p1.setImage("img", "/icons/grafo1.png"); >> } >> }); >> >> Since you might want to do this often, it might make sense to make your >> own "HoverHandler": >> >> public interface HoverHandler extends MouseOverHandler, MouseOutHandler {} >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to google-web-toolkit@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.