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

REGRESSION: JTree does not paint "focused" node correctly, yellow border missing

XMLWordPrintable

    • b37
    • x86
    • windows_nt, windows_xp

      Name: jk109818 Date: 05/07/2003


      FULL PRODUCT VERSION :
      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

      FULL OS VERSION :
      Windows NT Version 4.0

      A DESCRIPTION OF THE PROBLEM :
      JTree does not paint "focused" node correctly. If focus is on a JTree control, and a node is selected, a yellow dotted line should be painted around the node, but it is not.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Execute the program below.
      2) Select a node on a tree by clicking on a node
      3) Observe that yellow focus border is not painted


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected yellow dotted line to be painted around "focused" JTree node.
      ACTUAL -
      Yellow dotted line was not painted around "focused" JTree node.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package focustest;

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

      public class FocusTest
      {
        public static void main(String[] args)
        {
          // set windows look and feel
          try
          {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }
          catch (Exception exc)
          {
          }

          JFrame frame = new JFrame("Test");

          JTree tree = new JTree();

          frame.getContentPane().add(new JScrollPane(tree));

          JButton button = new JButton("OK");

          frame.getContentPane().add(button, BorderLayout.SOUTH);

          frame.setSize(500, 500);
          frame.setVisible(true);

          tree.requestFocus();

          frame.addWindowListener(new WindowAdapter()
          {
            public void windowClosing(WindowEvent e)
            {
              System.exit(0);
            }
          });
        }
      }
      ---------- END SOURCE ----------

      Release Regression From : 1.4.1_02
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 185276)
      ======================================================================

            apikalev Andrey Pikalev
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: