File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes displaying multiple lines of text in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "displaying multiple lines of text in JTextArea" Watch "displaying multiple lines of text in JTextArea" New topic
Author

displaying multiple lines of text in JTextArea

Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
consider the code of displaying multiple lines of text in jtext area,how can i
display multiple lines of text,this code just displays the last string which is "ae", i need output to be displayed like following:
abc
de
asd
ae



thanks for support
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
Try something like
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Because the logic is wrong. You can do something like this.

There are many ways to achieve this. The example shown above is just an example.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19854
    
  20

JTextArea has an append method which can be used as well:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: displaying multiple lines of text in JTextArea