Re: Turning off line wrap in JTextPane




"Wes Harrison" <nospam@xxxxxxxx> wrote in message
news:43755463$0$14265$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> "Oliver Wong" <owong@xxxxxxxxxxxxxx> wrote in message
> news:3h5df.106442$y_1.5383@xxxxxxxxxxx
>
>> The paragraph that I thought was relevant to your question reads as
>> follows:
>>
>> <quote>
>> If your text is unstyled, consider using a JTextArea instead. Otherwise,
>> you might need to implement your own component.
>> </quote>
>
> The text is most definitely styled so I do need to use JTextPane. I
> thought
> turning off line wrap would be a simple thing and not have to implement my
> own component just to do that.

I think Java's styled text is modelled around HTML 3.2, where you can't
really turn off line wrapping. If someone knows otherwise, maybe they can
chime in on this thread, but as far as I know, you'll have to write your own
component.

- Oliver


.



Relevant Pages