Ill hint what you need to do, you will have to put in the effort of coding it.
-When the mouse is clicked, check if the mouse is in the paint area.
-If the mouse is in the paint area, update the x, y values of the paint to the mouse x, y coordinates (in the onPaint method, use variables for this). This will move the paint around to the mouse position while the mouse is being held down.
-when the mouse is released, stop moving the paint.
You should think of a logical way to do it before just trying to code it.