Diner - public Diner (String dinerName, Color genderColor,...

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

View Full Document Right Arrow Icon
//******************************************************************** // Diner.java Author: Lewis and Loftus // // Solution to Programming Project 4.10 //******************************************************************** / import java.awt.Graphics; import java.awt.Color; i public class Diner { private final int DINER_SIZE = 50; private String name; private Color gender; private int locationX, locationY; //----------------------------------------------------------------- // Sets up this diner with the specified 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 Diner (String dinerName, Color genderColor, int x, int y) { name = dinerName; gender = genderColor; locationX = x; locationY = y; } //-----------------------------------------------------------------// Draws the diner. //-----------------------------------------------------------------public void draw(Graphics page) { page.setColor (gender); page.fillOval (locationX, locationY, DINER_SIZE, DINER_SIZE); page.setColor (Color.black); page.drawString (name, (locationX+10), (locationY+30)); } }...
View Full Document

Ask a homework question - tutors are online