SplatPanel

SplatPanel - circle3 = new Circle(100 Color.cyan 60 85...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // SplatPanel.java Author: Lewis/Loftus // // Demonstrates the use of graphical objects. //******************************************************************** import javax.swing.*; import java.awt.*; public class SplatPanel extends JPanel { private Circle circle1, circle2, circle3, circle4, circle5; //----------------------------------------------------------------- // Constructor: Creates five Circle objects. //----------------------------------------------------------------- public SplatPanel() { circle1 = new Circle (30, Color.red, 70, 35); circle2 = new Circle (50, Color.green, 30, 20);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: circle3 = new Circle (100, Color.cyan, 60, 85); circle4 = new Circle (45, Color.yellow, 170, 30); circle5 = new Circle (60, Color.blue, 200, 60); setPreferredSize (new Dimension(300, 200)); setBackground (Color.black); } //-----------------------------------------------------------------// Draws this panel by requesting that each circle draw itself. //-----------------------------------------------------------------public void paintComponent (Graphics page) { super.paintComponent(page); circle1.draw(page); circle2.draw(page); circle3.draw(page); circle4.draw(page); circle5.draw(page); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online