Java examples for Swing:JTree
is Mouse Over JTree Path
//package com.java2s; import java.awt.event.MouseEvent; import javax.swing.JTree; public class Main { public static boolean isMouseOverTreePath(MouseEvent evt, JTree tree) { if (evt == null) { throw new NullPointerException("evt == null"); }// www .jav a2 s.c om if (tree == null) { throw new NullPointerException("tree == null"); } return tree.getRowForLocation(evt.getX(), evt.getY()) > 0; } }