TabbedPane: no longer add (internal) tab close button component as child to JTabbedPane (issue #219)

This commit is contained in:
Karl Tauber
2020-11-29 01:32:38 +01:00
parent 5ef0c9aae1
commit e07ae90d09
2 changed files with 13 additions and 14 deletions

View File

@@ -12,14 +12,16 @@ FlatLaf Change Log
and "One Dark" themes.
- TabbedPane: Support hiding tab area if it contains only one tab. (set client
property `JTabbedPane.hideTabAreaWithOneTab` to `true`)
- Table: Do not paint last vertical grid line if auto-resize mode is not off.
(issue #46)
- Table: Fixed unstable grid line thickness when scaled on HiDPI screens. (issue
#152)
#### Fixed bugs
- Table: Do not paint last vertical grid line if auto-resize mode is not off.
(issue #46)
- Table: Fixed unstable grid line thickness when scaled on HiDPI screens. (issue
#152)
- TabbedPane: No longer add (internal) tab close button component as child to
`JTabbedPane`. (issue #219)
- Custom window decorations: Title bar was not hidden if window is in
full-screen mode. (issue #212)

View File

@@ -362,11 +362,6 @@ public class FlatTabbedPaneUI
protected void installComponents() {
super.installComponents();
// create tab close button
tabCloseButton = new TabCloseButton();
tabCloseButton.setVisible( false );
tabPane.add( tabCloseButton );
// find scrollable tab viewport
tabViewport = null;
if( isScrollTabLayout() ) {
@@ -393,11 +388,7 @@ public class FlatTabbedPaneUI
super.uninstallComponents();
if( tabCloseButton != null ) {
tabPane.remove( tabCloseButton );
tabCloseButton = null;
}
tabCloseButton = null;
tabViewport = null;
}
@@ -934,6 +925,12 @@ public class FlatTabbedPaneUI
}
protected void paintTabCloseButton( Graphics g, int tabIndex, int x, int y, int w, int h ) {
// create tab close button
if( tabCloseButton == null ) {
tabCloseButton = new TabCloseButton();
tabCloseButton.setVisible( false );
}
// update state of tab close button
boolean rollover = (tabIndex == getRolloverTab());
ButtonModel bm = tabCloseButton.getModel();