Scrolling Text (version 1.0)

 

 

The applet above of scrolling text marquee is an excellent example of simple animation and double buffering in Java. The source code was part of the original "The Java(tm) Tutor" series back in 1996 and is available here: ScrollText.java, and ScrollTextApplet.java.

 

Introduction

Based on the applet above, My lab 2 is a "beanified" version with several enhancements. I rewrote the paint function and added several accessor functions to allow the bean properties to be visible and changed by the user. I also added a SimpleBeanInfo extension to associate a customized property editor to the animation speed. My original concept was to replace the drop-down property editor with a JSlider component that would regulate the animation speed. This became to time-consuming and complicated (but what till my next version!)

Running This Lab

Download the jar file, lab2.jar (or lab2.zip), and place this in the jars subdirectory in your BDK environment. Start up the beanbox, and the "ScrollText" label with its blinking icon will appear. Click on this and drop it on the BeanBox. Experiment with the properties: change the text message, the fontStyle, the foreground and background colors, and such. The DOS console will display changes in the message and what functions are being called. These messages were useful in debugging this bean.

Lab Complexity

As stated before, I wanted to create my own custom editor for at least one of the properties of this bean. This required adding an extension to the SimpleBeanInfo to associate this. With more time, I would like to have create a complete Customizer interface which would have completely replaced the default property sheet. As it turned out, I made a simpler custom editor for one of the properties of this bean.

Deliverables