Advertisement
RazorBlade57

Robot

Oct 5th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. //Β© A+ Computer Science  -  www.apluscompsci.com
  2. //Name -
  3. //Date -
  4. //Class -
  5. //Lab  -
  6.  
  7. import java.awt.Graphics;
  8. import java.awt.Color;
  9. import java.awt.Canvas;
  10.  
  11. class Code extends Canvas
  12. {
  13.    public Code()    //constructor method - sets up the class
  14.    {
  15.       setSize(800,600);
  16.       setBackground(Color.WHITE);      
  17.       setVisible(true);
  18.    }
  19.  
  20.    public void paint( Graphics window )
  21.    {
  22.        
  23.        Code run = new Code();
  24.        Code bod = new Code();
  25.        
  26.       window.setColor(Color.BLUE);
  27.  
  28.       window.drawString("Robot LAB ", 35, 35 );
  29.  
  30.      
  31.       bod.upperBody(window);
  32.      
  33.       run.head(window);
  34.    }
  35.  
  36.    public void head( Graphics window )
  37.    {
  38.       window.setColor(Color.YELLOW);
  39.  
  40.       window.fillOval(300, 50, 200, 200);
  41.  
  42.  
  43.         //add more code here
  44.                
  45.    }
  46.  
  47.    public void upperBody( Graphics window )
  48.    {
  49.         window.setColor(Color.GRAY);
  50.         window.fillRect(350, 150, 100, 300);
  51.    }
  52.  
  53.    public void lowerBody( Graphics window )
  54.    {
  55.  
  56.         //add more code here
  57.  
  58.    }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement