Back

ScrollableLabel Example

The ScrollableLabel is a useful widget for when you need a static textual representation (ie. no editing) with automatic word-wrapping and scrollbar management. You set the number of columns and rows to initially display and the widget takes care of the rest.

The Source

ScrollableLabel.java
SLTest.java (this applet)
SLFrame.java (this applet's Frame)


Push the button below for a frame containing a ScrollableLabel and a text field. Typing into the text field and hitting return will append the text to the ScrollableLabel. Click a font button to change the font typeface. Resize the frame to see how the widget re-wraps its text.


Jean-Guy Speton
Last modified: Tue Feb 4 17:02:49 PST