Write a Java Applet Program to draw lines.
import java.awt.Graphics; // This applet draws a pair of lines using the Graphics class
import java.applet.Applet;
public class DrawLines extends Applet
{
public void paint(Graphics g)
{
// Draw a line from the upper-left corner to the point at (40, 20)
g.drawLine(0, 0, 40, 20);
// Draw a line from (20, 70) to (100, 150)
g.drawLine(20, 70, 100, 150);
}
}
/* <applet code=DrawLines width = 150 height = 150>
</applet>
*/