Here you can find the source of drawLine(Graphics g, int x1, int y1, int x2, int y2)
(x1, y1)
and (x2, y2)
in this graphics context's coordinate system.
Parameter | Description |
---|---|
x1 | the first point's <i>x</i> coordinate. |
y1 | the first point's <i>y</i> coordinate. |
x2 | the second point's <i>x</i> coordinate. |
y2 | the second point's <i>y</i> coordinate. |
public static void drawLine(Graphics g, int x1, int y1, int x2, int y2)
//package com.java2s; //License from project: Open Source License import java.awt.Graphics; public class Main { /**// w w w.j a v a2 s. c o m * Draws a line, using the current color, between the points * <code>(x1, y1)</code> and <code>(x2, y2)</code> * in this graphics context's coordinate system. * @param x1 the first point's <i>x</i> coordinate. * @param y1 the first point's <i>y</i> coordinate. * @param x2 the second point's <i>x</i> coordinate. * @param y2 the second point's <i>y</i> coordinate. */ public static void drawLine(Graphics g, int x1, int y1, int x2, int y2) { g.drawLine(x1, y1, x2, y2); } }