JDK-8078269 : JTabbedPane UI Property TabbedPane.tabAreaBackground no longer works
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2015-04-20
  • Updated: 2018-02-15
  • Resolved: 2015-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u162Fixed 9 b72Fixed
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
The UI property TabbedPane.tabAreaBackground no longer works as expected under Java 8.



REGRESSION.  Last worked in version 7u75

ADDITIONAL REGRESSION INFORMATION: 
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode, sharing)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the working test code below.



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The color of the tab area header where there are not tabs should be red.
ACTUAL -
The tab area background retains it's default blue color if the UI and Theme are left untouched. This is not the same blue as the default tab background.

Also, if you set a background color on the JTabbedPane, both the tabs and the unused tab area get that background color. The tabAreaBackground still has no effect.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package test;

import java.awt.*;
import javax.swing.*;

public class TabAreaBackgroundTest {

  public static void main(String s[]) {

    UIManager.put("TabbedPane.tabAreaBackground", Color.RED);

    JFrame frame = new JFrame("tabAreaBackground Test");

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    JTabbedPane tabPane = new JTabbedPane();

    // additional, optional test case which changes color of both tabs and tab area
    //tabPane.setBackground(Color.BLUE);
                
    tabPane.addTab("Tab 1", new JPanel());
    tabPane.addTab("Tab 2", new JPanel());
    tabPane.setOpaque(true);
        
    panel.add(tabPane);

    frame.add(panel, BorderLayout.CENTER);
    frame.setSize(300, 300);
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
    
  }

}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
None found yet.


Comments
This is a regression of https://bugs.openjdk.java.net/browse/JDK-8007563
24-04-2015

Semyon, please verify is it a regression in 8u40? Does it affect 8 GA (b132) as well?
22-04-2015

Reproduced on 9b60, not reproduced on 9b15
21-04-2015