Forums Register Login

Weird chars at end of line in JTextArea

+Pie Number of slices to send: Send
I am getting these weird characters at the end of the line in JTextArea when I use setText.
I am doing the foll:
//Creation of JTextArea
JPanel p2 = new JPanel(); // for JTextArea and video
displayText = new JTextArea(15,30);
JScrollPane scrollPane = new JScrollPane(displayText);
p2.add(scrollPane);
//Wrapping the lines
// I read the lines from a file, set a text and use foll code to wrap the lines.
setLineWrap(true);
setWrapStyleWord(true);
The text from the file is displayed correctly. But the last line of the para is filled by weird characters ( to complete the line I guess).
Any idea of this strange behaviour?

------------------
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1071 times.
Similar Threads
Adding ScrollBar to JTextArea
JTextArea line wrap
How to Resize JScrollPane used in a JPanel?
Scroll Pane not visible on Frame window
filenotfound Exception encountered,kindly help
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:22:00.