Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Limiting the width of a JTextArea
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jaysonturner" data-source="post: 357832" data-attributes="member: 29088"><p>basically create a new instance of JTextArea, and make it say 20 columns wide and 5 rows high.</p><p></p><p>[CODE]JTextArea area = new JTextArea(5, 20);[/CODE]</p><p></p><p>now tell it wrap...</p><p></p><p>[CODE]area.setLineWrap();[/CODE]</p><p></p><p>or to wrap without breaking words use..</p><p></p><p>[CODE]area.setWrapStyleWord();[/CODE]</p><p></p><p>hope this helps <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="jaysonturner, post: 357832, member: 29088"] basically create a new instance of JTextArea, and make it say 20 columns wide and 5 rows high. [CODE]JTextArea area = new JTextArea(5, 20);[/CODE] now tell it wrap... [CODE]area.setLineWrap();[/CODE] or to wrap without breaking words use.. [CODE]area.setWrapStyleWord();[/CODE] hope this helps :) [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Limiting the width of a JTextArea
Top