Methods to access a tab in a window programmatically

see: https://sourceforge.net/forum/forum.php?thread_id=1664032&forum_id=610548
for details
This commit is contained in:
kthiemann 2007-02-16 09:59:05 +00:00
parent 6a976b51dd
commit e0d6af9820
1 changed files with 27 additions and 0 deletions

View File

@ -2100,6 +2100,33 @@ public final class APanel extends CPanel
return m_curTab; return m_curTab;
} // getCurrentTab } // getCurrentTab
/**
* Get the number of tabs in the panels JTabbedPane.
* @return no of tabs in the JTabbedPane of the panel
*/
public int noOfTabs() {
return m_curWinTab.getTabCount();
}
/**
* Get the selected tab index of the panels JTabbedPane.
* @return selected index of JTabbedPane
*/
public int getSelectedTabIndex() {
return m_curWinTab.getSelectedIndex();
}
/**
* Get the name of the selected tab in the panels JTabbedPane.
* @return name of selected tab
*/
public String getSelectedTabName() {
String title = m_curWinTab.getTitleAt(m_curWinTab.getSelectedIndex());
title = title.substring(title.indexOf("<html>")+6);
title = title.substring(0,title.indexOf("<"));
return title;
}
/** /**
* String representation * String representation
* @return String representation * @return String representation