Robot - window.fillOval( 393, 150, 15, 10 );...

Info iconThis preview shows pages 1–2. 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 - Robot import java.awt.Graphics; import java.awt.Color; import java.awt.Canvas; class Robot extends Canvas { public Robot() //constructor method - sets up the class { setSize(800,600); setBackground(Color.WHITE); setVisible(true); } public void paint( Graphics window ) { window.setColor(Color.BLUE); window.drawString("Robot LAB ", 35, 35 ); head(window); upperBody(window); lowerBody(window); } public void head( Graphics window ) { window.setColor(Color.YELLOW); window.fillOval(300, 100, 200, 100); window.setColor(Color.GREEN); window.fillOval( 350, 120, 20, 20 ); window.setColor(Color.GREEN); window.fillOval( 430, 120, 20, 20 ); window.setColor(Color.BLACK);
Background image of page 1

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

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

Unformatted text preview: window.fillOval( 393, 150, 15, 10 ); window.setColor(Color.RED); window.drawArc(390, 165, 20, 20, 0, -180 ); } public void upperBody( Graphics window ) { window.setColor(Color.BLUE); window.fillRect( 350, 210, 100, 60 ); window.setColor(Color.GRAY); window.drawLine(450,210,550,150); window.drawLine(350,210,250,150); window.setColor(Color.YELLOW); window.drawRect(350,210,100,60); } public void lowerBody( Graphics window ) { window.setColor(Color.GRAY); window.fillRect( 350, 280, 100, 60 ); window.drawLine(450,340,550,400); window.drawLine(350,340,250,400); window.setColor(Color.YELLOW); window.drawRect(350, 280, 100, 60 ); } }...
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.

Page1 / 2

Robot - window.fillOval( 393, 150, 15, 10 );...

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