upper_left horizontal_line upper_right
vertical_line My Name vertical_line
lower_left horizontal_line horizontal_circle horizontal_line horizontal_circle horizontal_line lower_right
pixel vertical_line pixel vertical_line pixel
dot
pixel personal pixel projects pixel papers pixel private pixel about
dot
pixel projects pixel ScrollableBar pixel
dot
pixel
upper_left horizontal_line up horizontal_line page nothing number slash number nothing closing_brace horizontal_line lower_right
Scrolling on Demand:
A scrollable toolbar component

Modern GUI programs offer the possibility to easily access status informations and functionalities by means of various menus, toolbars and information panels. However, as a program becomes more complex, or in the case where users have the possibility to configure and extend these components, they often tend to get overfilled. This leads to scrambled or even truncated components.

This article introduces a new container component called ScrollableBar, which can be used as a wrapper for any Swing component. As long as there is enough place to layout the contained component, ScrollableBar is completely transparent. As soon as the available space gets too small however, ScrollableBar will fade in two small arrow buttons on the left and the right side (or on the top and the bottom side if in vertical mode), which can be used to scroll the underlying component, thus avoiding the above mentioned problems.

ScrollableBar is a lightweight container derived from JComponent which uses the standard Swing classes JViewport and JButton to achieve its functionality. It fills a gap in the set of the standard Swing components and offers the possibility to create more robust and intuitive user interfaces.

Notice: This is a preliminary version of the paper published in Java Developer Journal Vol 9/Issue 7, July 2004

PDF Version (1.6Mb),

The source code presented in the paper is available for download as a single jar-file ScrollableBar.jar (165kb).

upper_left horizontal_line up horizontal_line horizontal_circle horizontal_line page nothing number slash number nothing closing_brace horizontal_line horizontal_circle horizontal_line lower_right
pixel vertical_line pixel vertical_line pixel
pixel
email last_updated
pixel