1

I am writing a JavaFX application and I added a Canvas to a window.

Now when I register events for mouse move and mouse pressed for the canvas, I can react to mouse moving and mouse button being pressed. However, there is no mouse move event as long as a button is pressed.

Suppose I wanted to implement a simple MS Paint style painting operation where the user presses a mouse button and drags the mouse over the canvas to draw. Would I try to do this with mouse move and mouse pressed events, or would this be a matter of DragEvents?

I am asking because for some reason I thought DragEvent was for real drag and drop and not every operation that involved dragging.

wirrbel
  • 3,173
  • 3
  • 26
  • 49
  • Possible duplicate of [*How to draw a continuous line with mouse on JavaFX canvas?*](https://stackoverflow.com/q/43429251/230513) – trashgod Dec 28 '18 at 12:35

0 Answers0