views:

85

answers:

1

Hi,
How to check whether a tab in 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 or not in the tab class (nested class) itself.
Can anybody please suggest me something?
Thank you!

+1  A: 

Your component has a parent, eventually the JTabbedPane. JTabbedPane has methods like getSelectedIndex() or getSelectedComponent().

The MYYN
Thank u. But How can I call these methods in the nested class of JTabbedPane? as the need is to see whether a tab is selected or not and if it is I have to update the contents by removing old version of a component and replacing it with new one. How to achieve it?
Supereme