SmileyFace - window.drawString("SMILEY FACE LAB...

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

View Full Document Right Arrow Icon
//© A+ Computer Science - www.apluscompsci.com //Name -Dat Le //Date -8/29/11 //Lab -SmileyFace import java.awt.Graphics; import java.awt.Color; import java.awt.Canvas; public class SmileyFace extends Canvas { public SmileyFace() //constructor - sets up the class { setSize(800,600); setBackground(Color.WHITE); setVisible(true); } public void paint( Graphics window ) { smileyFace(window); } public void smileyFace( Graphics window ) { window.setColor(Color.BLUE);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: window.drawString("SMILEY FACE LAB ", 35, 35); window.setColor(Color.YELLOW); window.fillOval( 210, 100, 400, 400 ); window.setColor(Color.GREEN); window.fillOval( 470, 220, 60, 40 ); window.setColor(Color.GREEN); window.fillOval( 290, 220, 60, 40 ); window.setColor(Color.BLACK); window.fillOval( 390, 300, 40, 40 ); window.setColor(Color.RED); window.drawArc( 335, 350, 150, 100, 0, -180 ); //add more code here } }...
View Full Document

This note was uploaded on 11/11/2011 for the course C++ comp122 taught by Professor N/a during the Spring '07 term at Cy-Fair College.

Ask a homework question - tutors are online