mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
TabbedPane: fixed NPE in scroll layout when removing last tab
This commit is contained in:
@@ -16,7 +16,7 @@ FlatLaf Change Log
|
||||
- TabbedPane: Support adding custom components to left and right sides of tabs
|
||||
area. (set client property `JTabbedPane.leadingComponent` or
|
||||
`JTabbedPane.trailingComponent` to a `java.awt.Component`) (issue #40)
|
||||
- TabbedPane: Support closable tabs. (issue #40)
|
||||
- TabbedPane: Support closable tabs. (issues #31 and #40)
|
||||
- Support painting separator line between window title and content (use UI value
|
||||
`TitlePane.borderColor`). (issue #184)
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user