draw Circle Through Center - Java java.awt

Java examples for java.awt:Graphics2D

Description

draw Circle Through Center

Demo Code


//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*/
}

Related Tutorials