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

Scrollable Tabs don't appear with JDK7 Synth based LaF, different from Java 5/6

    Details

    • Subcomponent:
    • Resolved In Build:
      b143
    • CPU:
      x86
    • OS:
      windows_xp, windows_7
    • Verification:
      Verified

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b136)
      Java HotSpot(TM) Client VM (build 21.0-b06, mixed mode, sharing)


      A DESCRIPTION OF THE PROBLEM :
      When a JTabbedPane is configured to display tabs in scrollable mode (tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT)), only the tab text appears. The tabs are not painted - no background appears.


      REGRESSION. Last worked in version 6u24

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Configure tabbed pane for scrollable mode:
      tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Tab background should be painted.
      ACTUAL -
      No tab background is painted.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Component;
      import java.awt.Container;
      import java.awt.Label;
      import java.util.ArrayList;
      import java.util.List;

      import javax.swing.Icon;
      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JScrollPane;
      import javax.swing.JTabbedPane;
      import javax.swing.UIManager;

      public class ScrollableTabbedPaneTest extends JFrame
      {
        public static void main(String[] args) throws Exception
        {
          UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
          new ScrollableTabbedPaneTest();
        }
        
        public ScrollableTabbedPaneTest() throws Exception
        {
          super("ScrollableTabbedPane Test");
          JTabbedPane tabbedPane = new JTabbedPane();
          tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
          
          Icon icon = UIManager.getIcon("Tree.closedIcon");
          for (int i = 1; i<20; i++)
            tabbedPane.addTab("Tab" + i, icon, new Label("Pane"+i));
          add(tabbedPane);
              
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(400, 300);
          setLocationRelativeTo(null);
          setVisible(true);
        }
        
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kizune Alexander Zuev
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: