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

D3D: Dragging the scroll bar of a JScrollPane containing a JTree causes incorrect red

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 6u10
    • Fix Version/s: 7
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Introduced In Version:
    • Resolved In Build:
      b43
    • CPU:
      x86
    • OS:
      windows_xp

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.6.0_10"
        Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
        Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]

        A DESCRIPTION OF THE PROBLEM :
        If there is a JTree in a JScrollPane, dragging the vertical scroll bar causes the node icons and labels to be redrawn incorrectly (they change colour and almost disappear in some cases)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run the attached code. Drag the scrollbar down

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Nodes should scroll with no artefacts
        ACTUAL -
        Node icons and labels change colour

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import javax.swing.*;
        import java.util.*;

        /**
         * Test case for redraw bug in JTree in 6.0u10
         *
         * Dragging the scroll bar of a JScrollPane containing a JTree causes incorrect redraw
         * of JTree nodes - icons and labels change colour and grow faint.
         *
         * HTML for IE:
         * <html>
         * <body>
         * <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100%" height="100%">
         * <param name="java_code" value="JTreeRedraw.class">
         * <param name="type" value="application/x-java-applet;version=1.4">
         * </object>
         * </body>
         * </html>
         */
        public class JTreeRedraw extends JApplet {

            private class TestPanel extends JPanel {

                public TestPanel() {
                    Vector<String> v = new Vector<String>();
                    for (int i = 0; i < 100; ++i)
                        v.add("Node " + i);

                    JTree t = new JTree(v);
                    JScrollPane sp = new JScrollPane(t);

                    add(sp);
                }
            }

            public void init() {
                SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            getContentPane().add(new TestPanel());
                        }
                    });
            }
        }


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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tdv Dmitri Trembovetski (Inactive)
                  Reporter:
                  ndcosta Nelson Dcosta (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: