Slider - super(size, size); setFilled(true);...

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

View Full Document Right Arrow Icon
/* * File: * ----------------------- * This class is an example of a runnable class that * animates a square sliding across the screen. */ import*; import java.awt.*; i public class Slider extends GRect implements Runnable { p public Slider(int size, Color color) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: super(size, size); setFilled(true); setColor(color); } public void run() { // animate a slide across the screen for(int i = 0; i < 1000/STEP; i++) { pause(40); move(STEP, 0); } } /* constants */ private static final double STEP = 5; }...
View Full Document

This note was uploaded on 02/18/2010 for the course CS 106A taught by Professor Sahami,m during the Fall '08 term at Stanford.

Ask a homework question - tutors are online