We can perform painting operation in applet by the mouseDragged() method of MouseMotionListener. .
In the above example, getX() and getY() method of MouseEvent is used to get the current x-axis and y-axis. The getGraphics() method of Component class returns the object of Graphics.
A11 Acharya Niketan
Mayur Vihar 1
Near MayurVihar Metro Station