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

DefaultTreeModel.nodeChanged(TreeNode node) did not refress the node

    XMLWordPrintable

Details

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Sun Microsystems Inc. SunOS 5.10

      A DESCRIPTION OF THE PROBLEM :
      I have a Java Swing Tree, like:
      ---------------------------------
       mTree = new JTree ();
          CheckBoxTreeCellRenderer renderer = new CheckBoxTreeCellRenderer ();
          mTree.setCellRenderer (renderer);
      ----------------------------------
       in Java 5 it works fine.
      but in Java 6, when when click a father Node's checkbox, the behavior shoud be should it's sub nodes's checkbox should also be selected, but the test result is no.

      I think the root cause is in Java SE 6
      ((DefaultTreeModel)tree.getModel()).nodeChanged(node);
      have no effect to current node's upper and sub node. but in Java SE 5, it works so.

      .if I manually invoke
       tree.revalidate();
      tree.repaint();

      it works fine.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. click the check box on father tree node
      2. check sub tree node, it should also be selected.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the select/unselect state of tree node should keep consistence.
      ACTUAL -
      on the contrary.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      Release Regression From : 5.0u10
      The above release value was the last known release where this
      bug was not reproducible. Since then there has been a regression.

      Attachments

        Activity

          People

            alexp Alexander Potochkin (Inactive)
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: