100_lecture35

100_lecture35 - Introduction to Computation and Problem...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computation and Problem Solving Prof. Steven R. Lerman and Dr. V. Judson Harward Class 35: Class 35: Active Learning: Using Threads Active Learning: Using Threads to Build an Animation to Build an Animation 2 Ticker Application Our goal is to use a separate thread to drive an animation that scrolls a string across the screen. In the full version, you can stop the animation by pressing the mouse down on the animation screen, and resume the animation by releasing the mouse. As a starting point, we give you Ticker0.java . Download it from the class web site and let's look at it together. It is not animated. Mouse clicks drive the string across the screen. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Ticker0 , Data Members public class Ticker0 extends JPanel { private String animationString; private Font animationFont; public static final Dimension DEFAULT_SIZE = new Dimension( 400, 200 ); private int animationWidth; private int xoffset; private int tickerWidth; 4 Ticker0 , Geometry Click to advance me. Click to advance me.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

100_lecture35 - Introduction to Computation and Problem...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online