mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -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
|
- TabbedPane: Support adding custom components to left and right sides of tabs
|
||||||
area. (set client property `JTabbedPane.leadingComponent` or
|
area. (set client property `JTabbedPane.leadingComponent` or
|
||||||
`JTabbedPane.trailingComponent` to a `java.awt.Component`) (issue #40)
|
`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
|
- Support painting separator line between window title and content (use UI value
|
||||||
`TitlePane.borderColor`). (issue #184)
|
`TitlePane.borderColor`). (issue #184)
|
||||||
|
|
||||||
|
|||||||
@@ -1844,6 +1844,13 @@ public class FlatTabbedPaneUI
|
|||||||
if( !useMoreButton && (backwardButton == null || forwardButton == null) )
|
if( !useMoreButton && (backwardButton == null || forwardButton == null) )
|
||||||
return; // should never occur
|
return; // should never occur
|
||||||
|
|
||||||
|
if( rects.length == 0 ) {
|
||||||
|
moreTabsButton.setVisible( false );
|
||||||
|
backwardButton.setVisible( false );
|
||||||
|
forwardButton.setVisible( false );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle bounds = tabPane.getBounds();
|
Rectangle bounds = tabPane.getBounds();
|
||||||
Insets insets = tabPane.getInsets();
|
Insets insets = tabPane.getInsets();
|
||||||
int tabPlacement = tabPane.getTabPlacement();
|
int tabPlacement = tabPane.getTabPlacement();
|
||||||
|
|||||||
Reference in New Issue
Block a user