Java examples for java.awt:Graphics2D
draw Circle Through Center
//package com.java2s; import java.awt.Graphics; public class Main { public static void drawCircleThroughCenter(Graphics g, int x, int y, int r) { int tmp_x = x - r; int tmp_y = y - r; int tmp_width = 2 * r; int tmp_height = 2 * r; g.drawOval(tmp_x, tmp_y, tmp_width, tmp_height); }/*from w w w . j a v a2s .c o m*/ }