Java Graphics Draw drawDisc(Graphics g)

Here you can find the source of drawDisc(Graphics g)

Description

draw Disc

License

LGPL

Declaration

public static void drawDisc(Graphics g) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.awt.Color;

import java.awt.Graphics;

public class Main {
    public static void drawDisc(Graphics g) {
        int width = g.getClipBounds().width;
        int height = g.getClipBounds().height;

        Color theColor = g.getColor();
        g.setColor(Color.DARK_GRAY);
        g.fillOval(4, 4, width - 8, height - 8);
        g.setColor(theColor);//from w  ww .  j a v  a 2s. co  m
        g.fillOval(6, 6, width - 12, height - 12);
    }
}

Related

  1. drawCoordinateAxes(Graphics2D g, Component comp)
  2. drawCross(Graphics2D g2d, int x, int y, int size)
  3. drawCrosshatch(Graphics2D g, Color color, int left, int right, int top, int height, int spacing, int verticalOffset)
  4. drawCube(Graphics g, int x, int y, int w, int h, int d, float fac)
  5. drawDiamond(Graphics2D g2d, int xPos, int yPos)
  6. drawDot(Graphics g, int x, int y)
  7. drawDots(Graphics g, int x0, int y0, int x1, int y1, int interval)
  8. drawDottedDashLine(Graphics2D g, int x1, int y1, int x2, int y2)
  9. drawDottedRect(Graphics g, int x, int y, int w, int h)