Advertisement
RazorBlade57

ShapePanel

Oct 10th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. //© A+ Computer Science  -  www.apluscompsci.com
  2. //Name -
  3. //Date -
  4. //Class -
  5. //Lab  -
  6.  
  7. import java.awt.Font;
  8. import java.awt.Color;
  9. import java.awt.Graphics;
  10. import java.awt.Graphics2D;
  11. import java.awt.Canvas;
  12. import javax.swing.JPanel;
  13. import java.awt.event.ActionEvent;
  14. import java.awt.event.ActionListener;
  15.  
  16. public class ShapePanel extends JPanel
  17. {
  18.     public ShapePanel()
  19.     {
  20.         setBackground(Color.WHITE);
  21.         setVisible(true);
  22.     }
  23.  
  24.     public void update(Graphics window)
  25.     {
  26.         paint(window);
  27.     }
  28.  
  29.     /*
  30.      *All of your test code should be placed in paint.
  31.      */
  32.     public void paint(Graphics window)
  33.     {
  34.         // BackRound Color
  35.         window.setColor(Color.BLACK);
  36.         window.fillRect(0,0,getWidth(), getHeight());
  37.         window.setColor(Color.BLACK);
  38.         window.drawRect(20,20,getWidth()-40,getHeight()-40);
  39.        
  40.         // (X,Y) (WIDTH HEIGHT)
  41.        
  42.         //Skeleton Head
  43.         window.setColor(Color.WHITE);
  44.         window.fillOval(230, 100, 250, 250);
  45.         window.fillOval(270, 220, 200, 170);
  46.  
  47.        
  48.  
  49.        
  50.        
  51.        
  52.        
  53.        
  54.        
  55.        
  56.        
  57.        
  58.        
  59.        
  60.  
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement