Circle

Circle - Circle.java Author Lewis/Loftus Represents a circle with a particular position size and color import java.awt public class Circle private

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //******************************************************************** // Circle.java Author: Lewis/Loftus // // Represents a circle with a particular position, size, and color. //******************************************************************** import java.awt.*; public class Circle { private int diameter, x, y; private Color color; //----------------------------------------------------------------- // Constructor: Sets up this circle with the specified values. //----------------------------------------------------------------- public Circle (int size, Color shade, int upperX, int upperY) { diameter = size; color = shade; x = upperX; y = upperY; } //----------------------------------------------------------------- // Draws this circle in the specified graphics context. //----------------------------------------------------------------- public void draw (Graphics page) { page.setColor (color); page.fillOval (x, y, diameter, diameter); } //-----------------------------------------------------------------...
View Full Document

This document was uploaded on 02/21/2011.

Page1 / 2

Circle - Circle.java Author Lewis/Loftus Represents a circle with a particular position size and color import java.awt public class Circle private

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online