TabbedPane: fixed NPE in scroll layout when removing last tab

This commit is contained in:
Karl Tauber
2020-10-20 10:37:31 +02:00
parent 700bb9b567
commit 9bc656a5c5
2 changed files with 8 additions and 1 deletions

View File

@@ -1844,6 +1844,13 @@ public class FlatTabbedPaneUI
if( !useMoreButton && (backwardButton == null || forwardButton == null) )
return; // should never occur
if( rects.length == 0 ) {
moreTabsButton.setVisible( false );
backwardButton.setVisible( false );
forwardButton.setVisible( false );
return;
}
Rectangle bounds = tabPane.getBounds();
Insets insets = tabPane.getInsets();
int tabPlacement = tabPane.getTabPlacement();