How can I check whether a tab in a JTabbedPane instance is active or not, in the class of the tab (nested class) itself and not in the enclosing class?
I know that there is a method booloean isEnabledAt(int index);
but this method can only be called in the enclosing class. Whereas I want to check whether the tab is currently selected within the tab class itself (nested class).
Can anybody please suggest how?
Your component has a parent, eventually the JTabbedPane
. JTabbedPane
has methods like getSelectedIndex()
or getSelectedComponent()
.