Advertisement
Guest User

splatpanel

a guest
Oct 20th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.51 KB | None | 0 0
  1. //********************************************************************
  2. //  SplatPanel.java       Author: Lewis/Loftus
  3. //
  4. //  Demonstrates the use of graphical objects.
  5. //********************************************************************
  6.  
  7. import javax.swing.*;
  8. import java.awt.*;
  9.  
  10. public class SplatPanel extends JPanel
  11. {
  12.    //private Circle circle1, circle2, circle3, circle4, circle5;
  13.  
  14.    //-----------------------------------------------------------------
  15.    //  Constructor: Creates five Circle objects.
  16.    //-----------------------------------------------------------------
  17.    public SplatPanel()
  18.    {
  19.          Circle[] Circles= new Circle[5];
  20.       // circles[] Circle= new Circle[5];
  21.        //FORMAT: X,Y,RADIUS
  22.     Circle  Circles1=new Circle(320, 90, 35);
  23.       //circles[2] = new Circle(50, 30, 20);
  24.       //circles[3] = new Circle(100, 60, 85);
  25.       //circles[4] = new Circle(45, 170, 30);
  26.      // circles[0] = new Circle(60, 200, 60);
  27.      Circles[1]=Circles1;
  28.  
  29.       setPreferredSize(new Dimension(1200, 600));
  30.       setBackground(Color.red);
  31.    }
  32.  
  33.    //-----------------------------------------------------------------
  34.    //  Draws this panel by requesting that each circle draw itself.
  35.    //-----------------------------------------------------------------
  36.    public void paintComponent(Graphics page)
  37.    {
  38.       super.paintComponent(page);
  39.  
  40.      Circles1.draw(page);
  41.      // circles[2].draw(page);
  42.     //  circles[3].draw(page);
  43.     //  circles[4].draw(page);
  44.     //  circles[0].draw(page);
  45.    }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement