Draw on a JComponent or JPanel by overriding paintComponent(). Assume g is a Graphics object, and all variables are type int unless otherwise declared. Angles (int startAngle, arcAngle) are in degrees counterclockwise from 3 o'clock. These methods use (x,y) at the top, left, corner and a width and height of the bounding box (except drawString() and drawLine()).
g.drawLine(x1, y1, x2, y2); |
No comments:
Post a Comment