Crayon - public Crayon(Color crayonColor int crayonLength...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Author: Lewis and Loftus // // Solution to Programming Project 4.11 //******************************************************************** / import java.awt.*; i public class Crayon { private final int BOTTOM = 150; private final int WIDTH = 25; private Color shade; private int length, location; //----------------------------------------------------------------- // Sets up this crayon with the specfied characteristics. //-----------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public Crayon (Color crayonColor, int crayonLength, int position) { shade = crayonColor; length = crayonLength; location = position; } //-----------------------------------------------------------------// Draws this crayon. //-----------------------------------------------------------------public void draw(Graphics page) { page.setColor (shade); page.fillRect (location, BOTTOM-length, WIDTH, length); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online