Before I re-invent the wheel (poorly), I'd like to know if there is a some existing Java code for wrapping text lines to a given maximum width. Ideally it would:
Edit: there are no "pixels" here, only java.lang.String. "maximum width" refers to the number of characters on a line.
Apache commons has WordUtils and wrap function in it:
http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/text/WordUtils.html
P.S. Looks like this is depricated and you need to use
instead.