user1226162 user1226162 - 1 year ago 125
Java Question

How to get the selected Tab of my TabPanel in GWT

I have created a

in GWT and add tabs
Now I want to get the selected tab so that if a user clicks on a close button, I can close that selected tab.

Here is my tabpanel code:

TabPanel tabPanelCvs =new TabPanel();
VerticalPanel vpnlCvsTab = new VerticalPanel();

Any idea how can I get the selected tab of my

Answer Source

For getting selected tab of TabPanel there is method: TabBar#getSelectedTab()

int selectedIndex = tabPanel.getTabBar().getSelectedTab();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download