0

Good Day i just wanted to ask what does (x1, y1, x2, y2) in g.drawLine in creating a line in java applet.. thanks in advance

3
Contributors
3
Replies
11
Views
5 Years
Discussion Span
Last Post by JamesCherrill
0

oops sorry.. what does x1, y1, x2 y2 means? in g.drawLine(x1, y1, x2, y2)

1

Every parameter of every public method of every Java API class is documented in the API documentation, and learning to use it is an absolutely essential skill for Java prgrammers
http://docs.oracle.com/javase/7/docs/api/

for drawLine it says

> public abstract void drawLine(int x1,
>             int y1,
>             int x2,
>             int y2)
> 
> Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphics context's coordinate system.
> 
> Parameters:
>     x1 - the first point's x coordinate.
>     y1 - the first point's y coordinate.
>     x2 - the second point's x coordinate.
>     y2 - the second point's y coordinate.
Votes + Comments
Thanks :)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.