Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8078269

JTabbedPane UI Property TabbedPane.tabAreaBackground no longer works

    XMLWordPrintable

Details

    • b72
    • x86
    • windows_7

    Backports

      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.

        Attachments

          Issue Links

            Activity

              People

                ssadetsky Semyon Sadetsky (Inactive)
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: