Q&A

Q1:How can I draw arcs that go clockwise rather than counterclockwise?
A1: You can accomplish this by specifying the size of the arc as a negative number. The arc will begin at the same point, but go in the opposite direction in an elliptical path. For example, the following statement draws an open arc at (35,20) that is 90 degrees long, begins at the 0 degree mark, goes clockwise, and has a height of 20 and a width of 15:
Arc2D.Float smile = new Arc2D.Float(35F, 20F, 15F, 20F,
    0F, -90F, Arc2D.Float.OPEN);
Q2:Ellipses and circles don't have corners. What are the (x,y) coordinates specified with the Ellipses.Float constructor method?
A2: The (x,y) coordinates represent the smallest x value and smallest y value of the oval or circle. If you ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.