Thursday, 2 April 2020

Program: Draw a rectangle using applet

Program: Draw a rectangle using the applet

Java code

import java.awt.*;
import java.applet.*;
public class rectangle extends Applet
{
    public void paint(Graphics g)
    {
        g.drawRect(35, 15, 125, 200);

        g.fillRoundRect(50, 30, 95, 170, 15, 15);
    }
}

HTML code
<applet code="rectangle" height="300" width="300" ></applet>


No comments:

Post a Comment