In order to use different font colours, I need to use a JTextPane rather than a JTextArea.
So I've changed the JTextArea in my application to a JTextPane, and find that there is
word wrapping where I didn't have any before. I want to turn all wrapping off and just use the scrollbars on the JScrollPane it's sitting on. How do I do this?
I found something
here that includes a demo of about 150 lines of code that I don't really understand.
Maybe there's another way, getting the pane to grow automatically so that the text doesn't have to wrap, or something like that?
Here's a screenshot of my app (put together with the help of NetBeans' GUI builder). The text output is taken from another class as a single
string with \n characters in it.
And here's what happens when I increase the length of the lines in the text to 160 columns: