- #1
zak100
- 462
- 11
Hi,
I am trying to draw circles at the end points of a line but circle centre is not exactly on the end point of the line. Can somebody please guide me.
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class JCircle extends Applet{
int x1=30;
int y1=30;
int x2=60;
int y2=60;
public void paint(Graphics g) {
g.drawLine(x1, y1,x2, y2);
g.drawOval( x1, y1, 10, 10);
g.drawOval( x2, y2, 10, 10);
}
}
Some body please guide me.
Zulfi.
I am trying to draw circles at the end points of a line but circle centre is not exactly on the end point of the line. Can somebody please guide me.
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class JCircle extends Applet{
int x1=30;
int y1=30;
int x2=60;
int y2=60;
public void paint(Graphics g) {
g.drawLine(x1, y1,x2, y2);
g.drawOval( x1, y1, 10, 10);
g.drawOval( x2, y2, 10, 10);
}
}
Some body please guide me.
Zulfi.