as lineman already written, you first have to add the label widget to
the DOM ,you could do it just after setting label to "hidden". Then
you also have to give the widget the property "position: absolute"....
in your case you could also use tooltips over widgets, they are better
fitted since they know where to show if, i.e. the target widget (like
your bin) is near to the edge of the screen, then the tooltip would be
placed in a position that is readible.

in its simplest way you could use the setTitle() on any control, which
would popup a simple text after a user holds with a mouse, a tooltip
(in GWT vanilla its called PopupPanel) can take any widget, like HTML
or image or whatsoever...

br,

On 21 Jul., 22:22, lineman78 <linema...@gmail.com> wrote:
> I believe you need to use the add(Widget, x, y) method on root panel
> when you add it in the first place so that it sets it as position
> absolute.  Why not just use the alt text on an image(setTitle)?  It is
> a lot less work and is accessable, meaning the alt text is what screen
> readers look to in order to describe an image for a blind person.
>
> On Jul 21, 2:16 pm, nacho <vela.igna...@gmail.com> wrote:
>
>
>
> > Hi, i want to do the following, i want to display a label when the
> > user passes the mouse over the image and i want to hide the label when
> > the user takes out the mouse from the image. Just like a toolkit.
>
> > What i did is the following, what am i missing?
>
> > final Label lblRecyclerBin = new Label("Recycler Bin");
> >                 lblRecyclerBin.setVisible(false);
>
> >                 RootPanel.get().add(lblRecyclerBin);
>
> >                 final Image imgRecyclerBin = new 
> > Image("images/icons/trashcan.png");
> >                 imgRecyclerBin.setHeight("40px");
> >                 imgRecyclerBin.setWidth("40px");
> >                 imgRecyclerBin.setStylePrimaryName("reflex");
>
> >                 imgRecyclerBin.addMouseOverHandler(new MouseOverHandler() {
> >                         public void onMouseOver(MouseOverEvent arg0) {
> >                                 lblRecyclerBin.setVisible(true);
>
> >                                 
> > RootPanel.get().setWidgetPosition(lblRecyclerBin,
> > imgRecyclerBin.getAbsoluteLeft(), imgRecyclerBin.getAbsoluteTop());
> >                         }
> >                 });

-- 
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-tool...@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.

Reply via email to