How to get selected tab of my TabPanel in GWT

I created a TabPanel in GWT and added tabs. Now I want to get the selected tab so that if the user clicks the close button, I can close this selected tab.

Here is my tab code:

  TabPanel tabPanelCvs =new TabPanel(); tabPanelCvs.setVisible(true); tabPanelCvs.setSize("900","800"); VerticalPanel vpnlCvsTab = new VerticalPanel(); tabPanelCvs.add(vpnlCvsTab,result.getResumeTitle()); 

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

+4
source share
1 answer

To get the selected TabPanel tab TabPanel there is a method: TabBar#getSelectedTab()

 int selectedIndex = tabPanel.getTabBar().getSelectedTab(); 
+9
source

Source: https://habr.com/ru/post/1397838/


All Articles