How to draw Line in java applet?

Hello Friends, 

Today I will explain how can we draw Line in java applet.
In this  program I have print simple lines but you can draw different lines with different size.

import java.awt.*;
import java.applet.*;
import java.awt.event.*;

/*


*/

public class twelve extends Applet
{
public void paint(Graphics g)
{
g.drawLine(10,100,10,100);
g.drawLine(20,20,20,100);
g.drawLine(30,30,30,100);
g.drawLine(40,40,40,100);
g.drawLine(50,50,50,100);


}
}

Leave a Reply