This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
Try something like


Ping & DNS - updated with new look and Ping home screen widget
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: 19541
    
  16

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
 
Similar Threads
Stings: how many objects created?
Difference between s = "" and new String("a")
regular expression problem
unable to sort Object[]
how to match