JTextArea

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2008
Posts: 47
Reputation: Blackeagle is an unknown quantity at this point 
Solved Threads: 1
Blackeagle's Avatar
Blackeagle Blackeagle is offline Offline
Light Poster

JTextArea

 
0
  #1
Jan 4th, 2009
Hello,

i'm trying to make a a list of items in a Text Area, something like this:

apple 2 22
banana 31 1
orange 1 3


i want to it o be organized such that the numbers are in one column, and thats not working with me since the names of fruit have different lengths.
i tried to use insert ( str , pos ); method, but it didnt work well for me.
is there a method that might help?
Black Eagle
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 47
Reputation: Blackeagle is an unknown quantity at this point 
Solved Threads: 1
Blackeagle's Avatar
Blackeagle Blackeagle is offline Offline
Light Poster

Re: JTextArea

 
0
  #2
Jan 4th, 2009
and i cant even post them under each other in my my post here as well.
i hope u got what i'm asking for?
Black Eagle
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 121
Reputation: puneetkay is on a distinguished road 
Solved Threads: 23
puneetkay's Avatar
puneetkay puneetkay is offline Offline
Junior Poster

Re: JTextArea

 
0
  #3
Jan 4th, 2009
Originally Posted by Blackeagle View Post
and i cant even post them under each other in my my post here as well.
i hope u got what i'm asking for?
Hello,

try it like this :
  1. "apple\t2\t22"
  2. "banana\t31\t1"
  3. "orange\t1\t3"

escape sequence (valid ones are \b \t \n \f \r \" \' \\ )

Edited :
  1. textAreaObj.setText("apple\t2\t22\nbanana\t31\t1\norange\t1\t3");

Output:
  1. apple 2 22
  2. banana 31 1
  3. orange 1 3

Regards,
Last edited by puneetkay; Jan 4th, 2009 at 7:33 am.
Puneet Kalra
www.PuneetK.com
Sun Certified Java Programmer


Admin of Pikk - Object Relational Mapping Framework
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 47
Reputation: Blackeagle is an unknown quantity at this point 
Solved Threads: 1
Blackeagle's Avatar
Blackeagle Blackeagle is offline Offline
Light Poster

Re: JTextArea

 
0
  #4
Jan 4th, 2009
oh yeah it worked. many thanks to you
everything is in order now. thanks again
Black Eagle
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC