Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Β© A+ Computer Science - www.apluscompsci.com
- //Name -
- //Date -
- //Class -
- //Lab -
- import java.awt.Graphics;
- import java.awt.Color;
- import java.awt.Canvas;
- class Code extends Canvas
- {
- public Code() //constructor method - sets up the class
- {
- setSize(800,600);
- setBackground(Color.WHITE);
- setVisible(true);
- }
- public void paint( Graphics window )
- {
- Code run = new Code();
- Code bod = new Code();
- window.setColor(Color.BLUE);
- window.drawString("Robot LAB ", 35, 35 );
- bod.upperBody(window);
- run.head(window);
- }
- public void head( Graphics window )
- {
- window.setColor(Color.YELLOW);
- window.fillOval(300, 50, 200, 200);
- //add more code here
- }
- public void upperBody( Graphics window )
- {
- window.setColor(Color.GRAY);
- window.fillRect(350, 150, 100, 300);
- }
- public void lowerBody( Graphics window )
- {
- //add more code here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement