Printing contents of a JTextArea

Hi :) I'm currently trying to print the contents of aJTextArea using the recently newprint()method of theJTextComponentclass available to the newly released Java Mustang(Dec 2006).

I have been successful so far except : not all contents of each line are printed - it proceeds to printing the new line since the preceeding line's contents exceeds the margin of the paper.

Hope I have been able to articulate the problem.

I'm not sure if anyone has stumbled on this one (since the method's new and/or I'm new to Java) but just hoping someone can point me to the right direction.

Thanks in advance,

Lem

P.S.

The forum has been really a great help. I'm looking forward to return the favor soon (with or without Duke stars :))

[804 byte] By [lem@phila] at [2007-11-26 16:47:40]
# 1
Seems you have to reduce width of the JTextArea to fit the paper width.regards,Stas
StanislavLa at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...
# 2
nerver used mustang but have you tried to put line rap on?
Nibura at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...
# 3

> Seems you have to reduce width of the JTextArea to

> fit the paper width.

>

> regards,

> Stas

Hi Stas, thanks for replying :) Both yours and Niburs' advice helped.

Actually I've already tried setting the maximum width of the Text Area

(using the intuitive properties editor of NetBeans IDE) but it still keeps

on expanding - depending on the line length.

But thank you still - the combination worked: I've tried using (i'm not

sure if they are new methods to Java 6) the setLineWrap( ) and

setWrapStyleWord( ) of JTextArea, both setting it to true :)

Thanks Stas.

lem@phila at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...
# 4
> nerver used mustang but have you tried to put line> rap on?Just want to thank you personally, Nibur: Thanks. It worked! :)Both yours and Stas' suggestion helped a lot. Used those two new methods...
lem@phila at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...
# 5
it is manners like that that make people want to answer questions! thank you
Nibura at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...
# 6
> it is manners like that that make people want to> answer questions! thank youYou're welcome. :) really - being grateful is the very least I can do... Hope our paths meet again.
lem@phila at 2007-7-8 23:15:09 > top of Java-index,Desktop,Core GUI APIs...