File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes Weird chars at end of line in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "Weird chars at end of line in JTextArea" Watch "Weird chars at end of line in JTextArea" New topic
Author

Weird chars at end of line in JTextArea

Shital Shisode
Greenhorn

Joined: Nov 15, 2001
Posts: 7
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?

------------------
 
IntelliJ Java IDE
 
subject: Weird chars at end of line in JTextArea
 
Threads others viewed
How to Resize JScrollPane used in a JPanel?
Adding ScrollBar to JTextArea
filenotfound Exception encountered,kindly help
Scroll Pane not visible on Frame window
JTextArea line wrap
IntelliJ Java IDE