How do you add a MouseMotionListener to a canvas?

You see, the problem is that when I add a MouseMotionListener to a panel that has a canvas on it, none of the motion is picked up when I move my cursor across the canvas. But if I move my cursor ABOVE the canvas, where there is the real panel (i added my motionlistener to a panel) it works. THe problem is that I need it to work in the canvas too. :| Any Ideas?

Virum

[388 byte] By [Virum] at [2007-9-27 2:20:16]
# 1
Why did it not work the first time? I tried it again with adding the mouseMotionListener to the canvas, and it worked. I should of tried agian before asking, since my program crashed the first-time I tried it. Sorry to annoy you guys.
Virum at 2007-7-4 21:39:23 > top of Java-index,Archived Forums,Java Programming...