Hi Nitin,
With the current code you have implemented, you will get MOUSEOVER and
MOUSEOUT events over the entire TabPanel widget, which is composed of
separate components itself. This would explain why you are receiving
multiple "over" and "out" messages when you mouse over and out of the
TabPanel.

However, I don't think this is what you really want to do since I can't
think of any interface where moving over the entire tab panel leads to an
interesting event. The TabPanel itself is composed of a TabBar which holds a
number of tabs and their associated tab content in the form of various
subpanels or other widgets.

>From the fact that you asked about the difference between a TabPanel and a
TabBar, it seems like what you actually want to do is have a TabListener
added to the TabPanel and do interesting things when different tabs are
selected.

If that's the case, the link below should help get you on your way. If not,
please reply back and let us know what you're really trying to do. The way
you're trying to do it in the code snippet above isn't correct because of
the composition of the TabPanel itself.

TabPanel.addTabListener() javadoc:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/TabPanel.html#addTabListener(com.google.gwt.user.client.ui.TabListener)

Hope that helps,
-Sumit Chandel

On Tue, Sep 2, 2008 at 8:50 AM, Nitin <[EMAIL PROTECTED]> wrote:

>
> Hello GWT Expert,
>
>
> I need Mouse Over and Mouse Out  property of TabPanel . I have used
> this code . But It is not implementing mouse over property.
>
>
> import com.google.gwt.user.client.DOM;
> import com.google.gwt.user.client.Element;
> import com.google.gwt.user.client.Event;
> import com.google.gwt.user.client.Window;
>
>
> public class TabPanel extends com.google.gwt.user.client.ui.TabPanel
> {
>
>
>        public TabPanel() {
>
>                sinkEvents(Event.ONMOUSEOVER);
>                sinkEvents(Event.ONMOUSEOUT);
>        }
>
>
>        public void onBrowserEvent(Event event) {
>                super.onBrowserEvent(event);
>                Window.alert("over");
>
>                switch (DOM.eventGetType(event)) {
>                case Event.ONMOUSEOVER: {
>                        Window.alert("over");
>
>                        break;
>                }
>                case Event.ONMOUSEOUT: {
>                        Window.alert("out");
>                        break;
>                }
>                default: {
>                }
>                }
>        }
>
> }
>
>
> Please suggest solution .
> Could any one tell what is difference between TabPanel and TabBar .
>
> Thanks
>
> Nitin
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to