MouseAdaptedTreeMouseHandler Issue

  • Scott Y. Hong
    Scott Y. Hong

    What's the design reason that the following events
    are not overloaded in MouseAdaptedTreeMouseHandler

    mouseEntered(MouseEvent event)
    mouseExited(MouseEvent event)


    • Hi Scott,

      Good to see you here. I had implemented these method calls in earlier MouseAdaptedTreeMouseHandler. It looked as

      public void mouseEntered(MouseEvent e) {
          MouseListener node = getNode(e);
          if (node != null) {

      However soon I realized that a listener will receive mouseEntered() or mouseExited() only after the mouse enters or exits a Tree component at all, but not each particular node! So I removed them from a handler.

      Implementing mouseEntered() and mouseExited() would require working with MouseMotionListener.mouseMoved(), and I'm not sure how well it will work because a tree node is not actually treated as a Swing component. If you want, you could move in this direction, and contribute your findings back to our project.

      Thank you for interest in dotuseful project.

      Denis Krukovsky.