How can I draw smooth curves for graphs using the Graphics class?

John Zukowski

For smooth curves, use antialiasing (see http://www.jguru.com/jguru/faq/view.jsp?EID=79646). If you're not sure about drawing curves, use the drawArc() method of the Graphics class (see http://java.sun.com/j2se/1.3/docs/api/java/awt/Graphics.html). It doesn't use a center point, but a bounding rectangle, along with a start and end angle where 0 degrees is at the 3 o'clock position.