Section 12.20 JTextArea
• A JTextArea (p. 539)—a subclass of JTextComponent—may contain multiple lines of text.
• Class Box (p. 540) is a subclass of Container that uses a BoxLayout layout manager (p. 541) to arrange the GUI components either horizontally or vertically.
• Box static method createHorizontalBox (p. 541) creates a Box that arranges components from left to right in the order that they’re attached.
• Method getSelectedText (p. 541) returns the selected text from a JTextArea.
• You can set the horizontal and vertical scrollbar policies (p. 542) of a JScrollPane when it’s constructed. JScrollPane methods setHorizontalScrollBarPolicy (p. 542) and setVertical ScrollBarPolicy (p. 542) can be used to change the scrollbar policies at any ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access