Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个窗格,我需要重建其内容,然后将其与当前面板交换,但前提是它是当前选项卡。
你可以简单地这样做:
final int nTabIndex = myTabbedPane.indexOfTabComponent( myPanel ); final boolean bIsVisible = myTabbedPane.isEnabledAt( nTabIndex ); if ( bIsVisible ) { // Do stuff with myPanel myPanel.repaint(); }