|
im drawing 2 lines. One vertical and one horizontal...my vertical line shows no error but my horizontal line shows error...this is my code...by the way the horizontal line is animated with a timer class. im just showing code for whats producing my error.
private final int width=400,height=200;
private final int Vertical_X=160;
private int Start_X,Start_Y;
private int length_line_seg;
private int MoveX,MoveY;
private Timer timer;
private final int DELAY=20;
public MovingSegmentPanel() {
length_line_seg = 40;
Start_X=50;
Start_Y=40;
public void paintComponent(Graphics page)
{ super.paintComponent(page);
page.drawLine(Vertical_X,0,Vertical_X,height); //no errors
page.drawLine(Start_X,Start_Y,Start_X-lenght_line_seg,Start_X,Start_Y) //error here...can't apply int to graphics, but why does it work for my vertical line??
|
|
|
The drawLine method takes four int arguments. The second/last call to drawLine has five arguments.
|
|
|
|
|
|
|
|
|
|