Balloons - page.setColor (Color.black); page.drawLine (45,...

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

View Full Document Right Arrow Icon
//******************************************************************** // Balloons.java Author: Lewis and Loftus // // Solution to Programming Project 2.19 //******************************************************************** / import javax.swing.JApplet; import java.awt.*; i public class Balloons extends JApplet { //----------------------------------------------------------------- // Draws a set of balloons on strings. //----------------------------------------------------------------- public void paint (Graphics page) { setBackground (Color.white); // draw the strings
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: page.setColor (Color.black); page.drawLine (45, 95, 100, 300); page.drawLine (90, 100, 100, 300); page.drawLine (60, 100, 100, 300); page.drawLine (122, 85, 100, 300); page.drawLine (145, 115, 100, 300); // draw the balloons page.setColor (Color.blue); page.fillOval (20, 30, 50, 65); page.setColor (Color.yellow); page.fillOval (70, 40, 40, 60); page.setColor (Color.red); page.fillOval (40, 50, 40, 55); page.setColor (Color.green); page.fillOval (100, 30, 45, 55); page.setColor (Color.cyan); page.fillOval (120, 55, 50, 60); } }...
View Full Document

Ask a homework question - tutors are online