You are on page 1of 3

Department of Artificial Intelligence & Data Science

Subject: Object Oriented Programming with Java


Experiment No. 13

Name:Yatish Patil Roll No:20 Date: 25/11/2021

Aim: To implement a program on Graphics Class.


Implement a program to draw a Smiley Face on Applet using Graphics Class by making use
of various methods.

Software Used: JDK version 1.7.0_80

Theory:
1. Applet is a special type of program that is embedded in the webpage to generate the
dynamic content. It runs inside the browser and works at client side.
2. public void paint(Graphics g): is used to paint the Applet. It provides Graphics class
object that can be used for drawing oval, rectangle, arc etc
3. Syntax of Commonly used and implemented methods
Department of Artificial Intelligence & Data Science
Subject: Object Oriented Programming with Java
Experiment No. 13
Implementation:
1. Program

2. Output
Department of Artificial Intelligence & Data Science
Subject: Object Oriented Programming with Java
Experiment No. 13

Conclusion: Graphics class provides many methods to draw or fill different shapes, some of
those are drawString(), drawRect(), drawArc(), drawLine(), fillRect(), fillArc(), etc.

You might also like