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.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.BLACK);
- window.fillRect(0,0,getWidth(), getHeight());
- window.setColor(Color.BLACK);
- 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(270, 220, 200, 170);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement