![]() |
The Java Developers Almanac 1.4 |
|
e987. Enabling Word-Wrapping and Line-Wrapping in a JTextArea ComponentWith line-wrapping, breaks are allowed to occur in the middle of words. With word-wrapping, breaks are only allowed between words. JTextArea c = new JTextArea();
// Enable line-wrapping
c.setLineWrap(true);
c.setWrapStyleWord(false);
// Enable word-wrapping
c.setLineWrap(true);
c.setWrapStyleWord(true);
e983. Modifying Text in a JTextArea Component e984. Enumerating the Lines in a JTextArea Component e985. Setting the Tab Size of a JTextArea Component e986. Moving the Focus with the TAB Key in a JTextArea Component e988. Implementing a Console Window with a JTextArea Component
© 2002 Addison-Wesley. |