| Java >
Guidelines Home Page > Java Look and Feel Design Guidelines >
Part III: The Components of the Java Foundation Classes > 11: Text Components >
You can enable word wrap so that the text wraps to the next line when it reaches the edge of the text area, as shown in the preceding figure. You can enable scrolling by placing the text area inside a scroll pane. In this case, the text scrolls horizontally or vertically when it is too long to fit in the text area.
The following figure shows a text area inside a scroll pane. For information on scrolling, see Scroll Panes.Figure 180 Text Area in a Scroll Pane
If you place text in a scroll pane, ensure that the vertical scrollbar is always there and provide a horizontal scrollbar only as needed. This is not the default behavior of scroll panes.
If the text area contains prose, enable word wrap. If the text area contains information for which exact line breaks are important, such as code or poetry, enable horizontal scrolling.
wrapStyleWord properties of the text area can be set to true to enable word wrap on word boundaries.
|Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.