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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.