[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Linewrap after specific value  XML
Forum Index -> Development
Author Message
fschlott

Power User

Joined: 13/03/2009 19:09:22
Messages: 38
Offline

Hello,

is it possible to do a linewrap in a textarea-component at a specific value?
In my case i have a textarea-component with width 100%.
And i would like to set dynamically if it should do a line wrap at for example 20 or 40 letters, so not only depending on the width of the textarea.


Frank


krinninger

Power User

Joined: 17/11/2008 21:19:41
Messages: 567
Offline

Hello Frank,

i don't know exactly what you wan't to do, but if i get you right and you just want a linebreak after every n-chars, then there is WordUtils from Apache-Commons the thing that you need.

theres a method called wrap(String str, int wrapLength, String newLineStr, boolean wrapLongWords) which places a char (in your case "\n") every n-Chars. And this string you can input into textpane.

hope this helped you.
fschlott

Power User

Joined: 13/03/2009 19:09:22
Messages: 38
Offline

Hi,

thanks.
I didnĀ“t know about that method. Works fine for me.


Frank
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team