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

JTree's setToolTipText() doesn't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 6
    • 1.0
    • client-libs
    • None
    • beta
    • sparc
    • solaris_7

      JTree overrides getToolTipText(MouseEvent) and forwards the call to the renderer, which is good, but if the renderer doesn't have a tooltip it should fallback to that of super.getToolTipText. An implication of the current code is that setToolTipText on a JTree doesn't work.

      Here's a test case:

      import javax.swing.*;

      public class Test2 {
          public static void main(String[] args) {
              JTree tree = new JTree();
              tree.setToolTipText("TEST");
              JFrame frame = new JFrame("TEST");
              frame.getContentPane().add(new JScrollPane(tree));
              frame.pack();
              frame.show();
          }
      }

            apikalev Andrey Pikalev
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: