Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the selected Tab of my TabPanel in GWT

Tags:

java

gwt

I have created a TabPanel 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();
    tabPanelCvs.setVisible(true);
    tabPanelCvs.setSize("900","800");
    VerticalPanel vpnlCvsTab = new VerticalPanel();
    tabPanelCvs.add(vpnlCvsTab,result.getResumeTitle());

Any idea how can I get the selected tab of my TabPanel?

like image 966
user1226162 Avatar asked Jan 17 '23 10:01

user1226162


1 Answers

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

int selectedIndex = tabPanel.getTabBar().getSelectedTab();
like image 156
Jama A. Avatar answered Jan 20 '23 01:01

Jama A.