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

REGRESSION: toolbar buttons have visual artifacts with WinXP look and feel

    XMLWordPrintable

    Details

      Description

      FULL PRODUCT VERSION :
      H:\>java -version
      java version "1.5.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b07)
      Java HotSpot(TM) Client VM (build 1.5.0_02-b07, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP professional, Service Pack 1

      A DESCRIPTION OF THE PROBLEM :
      Under certain conditions, the JButtons on a JToolbar paint with weird visual artifacts. It generally happens after the mouse has passed over the button and it has been repainted.

      This seems to only occur under these conditions:
      - The buttons have no icons, just text
      - the buttons have a border ( EtchedBorder )
      - running JRE 1.5.0_02 (1.5.0_01 seems to work fine)
      - using the WindowsXP L&F
      - windows Display Properties configured to use Windows XP Style Windows and Buttons (everything works ok when its set to classic style)



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached test case, hover the mouse over the buttons. It usually takes several passes before you see the behavior. In other words, pass the mouse back and forth over all the buttons repeatedly. It seems to occur for me about the 6th pass.
      You should see weird colors develop along the bottom border of the buttons. I suspect it is a paint issue with the border.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args)
      throws Throwable
      {
      JFrame f = new JFrame("Toolbar Test");
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setSize(200,200);

      //f.myPanel.add(cBox, BorderLayout.NORTH);
      //f.myPanel.add(new JTextField("A Field"), BorderLayout.SOUTH);

      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");

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

      JToolBar toolBar = new JToolBar("This is the toolbar");
      toolBar.setFloatable(false);

      JButton btn1 = new JButton("Test111");
      btn1.setBorder(BorderFactory.createEtchedBorder());
      toolBar.add(btn1);
      JButton btn2 = new JButton("Test222");
      btn2.setBorder(BorderFactory.createEtchedBorder());
      toolBar.add(btn2);
      JButton btn3 = new JButton("Test333");
      btn3.setBorder(BorderFactory.createEtchedBorder());
      toolBar.add(btn3);

      //toolBar.setRollover(true);
      toolBarPanel.add(toolBar, BorderLayout.NORTH);
      f.add(toolBarPanel);

      //f.pack();
      f.setLocationRelativeTo(null);
      f.setVisible(true);

      }
      ---------- END SOURCE ----------

      Release Regression From : 5.0u1
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 2005-04-19 09:05:54 GMT

        Attachments

          Activity

            People

            Assignee:
            alexp Alexander Potochkin (Inactive)
            Reporter:
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: