Reputation: 4094
I have a pane that I need to rebuild the contents of and then swap it with the current panel, but only if it's the current tab.
Upvotes: 1
Views: 4956
Reputation: 9249
You can simply do this:
final int nTabIndex = myTabbedPane.indexOfTabComponent( myPanel );
final boolean bIsVisible = myTabbedPane.isEnabledAt( nTabIndex );
if ( bIsVisible ) {
// Do stuff with myPanel
myPanel.repaint();
}
Upvotes: 4