How to display Clock using Applet

An applet is a small program typically embedded within the web page which is used to create a dynamic and interactive application.Each applet that is created must be subclass of the Applet class, contained within the java.applet package. This class contains methods which govern the life and behavior of the Applet.

Addition of Two Numbers Using Applet

To build an applet, first of all we need to create an applet code(.java file). After successful compilation, its corresponding .class file is created. Then a web page also known as HTML document is to be developed. Once the HTML document is created, the applet is to be inserted in it. Finally the resultant HTML document will be executed to produce the desired output.

Paint method in Java

Paint method allows you to draw a text message ,draw an image,draw a rectangle,oval etc. You can set the color of the text and the diagram(oval,rect,fillrect).

Chess Board in Java Applet

Each square(rectangle) in the chessboard is 20 pixels by 20 pixels.The squares are grey and black.If the row and column are either even or odd, then the color is Grey.Otherwise, change color into Black.

How to draw Rectangle in Java Applet

Rectangle can be drawn by using drawLine() method. With this method, only the outline of the rectangle is drawn using Graphics object(Graphics gra)color but of the rectangle is not filled with this color. To draw a filled rectangle, the graphics class provide the fillRect() method.

Page 2 of 8