Applet for add two numbers

Applets are simple Java programs that runs in web browsers.The creation of web pages is related to Java Applet. An applet is an Internet based Java program that can be included in an HTML page.An applet is a Java class defined in JDK’s java. applet package.

Using the Font and FontMetrics Classes in Java

In Java,we my use the java.awt.Font class to set or retrieve the screen fonts. The name of the font can be a particular font such as “Arial”, Times New Roman”,etc.We can set the Font by using setFont() of the Graphics class.FontMetrics class is used to know the attributes of font within a program.

Draws Rectangles at user defined position in Java

We can draw geometrical shapes like rectangle, oval, ellipse etc through a programming language. We will need to set Coordinated through the program or trap the user’s mouse movements to draw at desired position.

How to create an event listener in Applet?

The Listener interfaces are defined in java.awt.event package we need to import the java.awt.event package. ActionListener is an interface we need to implements it for our class.

How to get screen size in Applet

getSize() method is used to find the size of an applet.We can find the height and width(in pixels) of the applet. The paint()method of the Applet class is used to display the result on the screen.

Page 4 of 8

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @