Javatpoint Logo
Javatpoint Logo

Painting in Applet

We can perform painting operation in applet by the mouseDragged() method of MouseMotionListener.

Example of Painting in Applet:

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.

myapplet.html






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA