Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //© A+ Computer Science - www.apluscompsci.com
- //Name - Christopher Clemente
- //Date - 12-10-2016
- //Class - AP Comp Sci
- //Lab -
- import java.awt.Font;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Canvas;
- import javax.swing.JPanel;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- public class ShapePanel extends JPanel
- {
- public ShapePanel()
- {
- setBackground(Color.WHITE);
- setVisible(true);
- }
- public void update(Graphics window)
- {
- paint(window);
- }
- /*
- *All of your test code should be placed in paint.
- */
- public void paint(Graphics window)
- {
- // BackRound Color
- window.setColor(Color.ORANGE);
- window.fillRect(0,0,getWidth(), getHeight());
- window.setColor(Color.RED);
- window.drawRect(20,20,getWidth()-40,getHeight()-40);
- // (X,Y) (WIDTH HEIGHT)
- //Skeleton Head
- window.setColor(Color.WHITE);
- window.fillOval(230, 100, 250, 250);
- window.fillOval(256, 195, 200, 200);
- window.setColor(Color.BLACK);
- window.fillOval(270, 175, 55, 55);
- window.fillOval(375, 175, 55, 55);
- window.fillOval(315, 270, 90, 90);
- window.setColor(Color.WHITE);
- window.fillOval(315, 240, 90, 90);
- window.fillRect(347, 370, 20, 150);
- window.fillRect(330, 580, 20, 150);
- window.fillRect(347, 430, 20, 150);
- window.fillRect(366, 580, 20, 150);
- window.fillRect(270, 420, 180, 20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement