Friday, March 15, 2019

Draw rectangle using drawline method using applet(java code).

                                                                                                                       edited by Samhrita

import java.applet.Applet;
import java.awt.Graphics;
import java.applet.*;
import java.awt.*;
public class rectangle extends Applet
{
public void paint(Graphics g)
{
g.drawLine(10,10,10,20);
g.drawLine(20,20,20,10);
g.drawLine(10,20,20,20);
g.drawLine(20,10,10,10);
}
}

No comments:

Post a Comment