Skip to content

Instantly share code, notes, and snippets.

@huettern
Created April 22, 2016 07:32
Show Gist options
  • Save huettern/ffbf0842a7dce7be2fc8a2592fc043a4 to your computer and use it in GitHub Desktop.
Save huettern/ffbf0842a7dce7be2fc8a2592fc043a4 to your computer and use it in GitHub Desktop.
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g.create();
Area plotArea = new Area(new Ellipse2D.Double(center.x-radius, center.y-radius, diameter,diameter));
g2.setClip(plotArea);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment