I have this code....
JTree myTree;
...omissis...
myTree.addMouseMotionListener(this);
...omissis...
public void mouseMoved(MouseEvent e) {
TreePath mPath = navigationMenu.getPathForLocation(e.getX(), e.getY());
System.out.println (mPath + " " + r);
}
Why it's work only for deja expanded JTree's nodes, but not for nodes
that i expand with mouse ? I can see these nodes, select it, but
getPathForLocation don't work...
any tips ?
Montag
> JTree myTree;
> ...omissis...
[quoted text clipped - 4 lines]
> System.out.println (mPath + " " + r);
> }
> Why it's work only for deja expanded JTree's nodes, but not for nodes
> that i expand with mouse ? I can see these nodes, select it, but
> getPathForLocation don't work...
> any tips ?
"navigationMenu" != "myTree"
Christian
Montag - 30 Nov 2005 16:36 GMT
Sorry it was a type error, the compiled code i use:
JTree myTree;
...omissis...
myTree.addMouseMotionListener(this);
...omissis...
public void mouseMoved(MouseEvent e) {
TreePath mPath = myTree.getPathForLocation(e.getX(),e.getY());
System.out.println (mPath + " " + r);
}
but not work (with the same problem...)
>> JTree myTree;
>> ...omissis...
[quoted text clipped - 14 lines]
>
> Christian
Christian Kaufhold - 30 Nov 2005 16:53 GMT
> Sorry it was a type error, the compiled code i use:
> JTree myTree;
> ...omissis...
[quoted text clipped - 4 lines]
> System.out.println (mPath + " " + r);
> }
> but not work (with the same problem...)
Please post a compilable example.
Christian
Oliver Wong - 30 Nov 2005 18:58 GMT
>> Sorry it was a type error, the compiled code i use:
>
[quoted text clipped - 10 lines]
>
> Please post a compilable example.
This page has a few tips on making sure your program is compilable, and
yet short enough that it doesn't make people give up after reading hundreds
of lines. Stuff like removing buttons which aren't relevant to the problem,
etc.
http://www.physci.org/codes/sscce.jsp
- Oliver