src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 985,995 ****
final Component component = getTabComponentAt(i);
final JMenuItem menuItem;
if (component == null) {
menuItem = new JMenuItem(tabPane.getTitleAt(i), tabPane.getIconAt(i));
} else {
! menuItem = new JMenuItem() {
public void paintComponent(final Graphics g) {
super.paintComponent(g);
final Dimension size = component.getSize();
component.setSize(getSize());
component.validate();
--- 985,996 ----
final Component component = getTabComponentAt(i);
final JMenuItem menuItem;
if (component == null) {
menuItem = new JMenuItem(tabPane.getTitleAt(i), tabPane.getIconAt(i));
} else {
! @SuppressWarnings("serial") // anonymous class
! JMenuItem tmp = new JMenuItem() {
public void paintComponent(final Graphics g) {
super.paintComponent(g);
final Dimension size = component.getSize();
component.setSize(getSize());
component.validate();
*** 999,1008 ****
--- 1000,1010 ----
public Dimension getPreferredSize() {
return component.getPreferredSize();
}
};
+ menuItem = tmp;
}
final Color background = tabPane.getBackgroundAt(i);
if (!(background instanceof UIResource)) {
menuItem.setBackground(background);