tags:

views:

309

answers:

1

How do I add MouseEvents, specifically MouseOutHandlers to an AbsolutePanel without creating a Composite widget? Or is this possible? From what I can tell it involves adding a DomHandler, and a HandlerRegistration.

A detailed example would be greatly appreciated considering I am quite new GWT and Java.

Thanks,

Eric

+2  A: 

You have to create custom AbsolutePanel. Follow the code.I think this should work.Now you can add mouse out handler to absolute panel.If you want to use all Mouse events implement HasAllMouseHandlers and implement all the methods.

   public class MyAbsolutePanel extends AbsolutePanel implements HasMouseOutHandlers{

    public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {  
       return addDomHandler(handler, MouseOutEvent.getType());  
     }  

  }
BlackPanther
So then I call MyAbsolutePanel? or am i wrong?
Eric Dorsey
Yes..You have to call MyAbsolutePanel instead of AbsolutePanel.
BlackPanther
Thanks so much. Worked perfectly.
Eric Dorsey