Respuesta :

Answer:

The answer for the given question is given below:

public void paint( Graphics g )

{

g.drawLine(100, 200 ,34, 67);

}

Explanation:

In this code we are using “drawLine” method to draw the line between the points

The graphics object “g” is to call the drawLine method .

The syntax of drawline method is given below

drawLine(int X1, int Y1, int X2, int Y2)

Where  X1,  Y1,  X2,  Y2 are the points in the x and y coordinate

Following are the full code of that program  

import java.applet.Applet; // package of applet

import java.awt.Graphics; // package of awt  

public class line1 extends Applet  //inherit applet class

{

public void paint( Graphics g ) // paint method

{

g.drawLine(100, 200 ,34, 67); // drawline

}

}

It draw the corresponding line between the coordinate