java.awt.Scrollbar

Although the advent of ScrollPane scrollpane takes away much of Scrollbar's scrollbar's thunder, scrollbars are still useful in their own right; for instance, a scrollbar could be used to implement a quick and dirty slider component—a component, in fact, that we'll use to illustrate the properties and events associated with scrollbars. Our slider contains a scrollbar and a label that displays the scrollbar's current value. For visual effect, we'll wrap the scrollbar and label in a 3D rectangle outlined with a black border. Figure 15-1 shows our slider component in action.

Figure 15-1. A Slider Component. A slider consists of a scrollbar and a label that displays the scrollbar's current value. The scrollbar and label are contained ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.