• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

How to set the text in JTextarea from bottom.  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I just want to set the text into textarea start from bottom to top.
But i am not able to do it.what should i supposed to do or is there any other component of having the propert to set the text from bottom to top.

waiting for reply.......
 
Sandeepesh shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sandeepshah shah wrote:Hi All,
I just want to set the text into textarea start from bottom to top.
But i am not able to do it.what should i supposed to do or is there any other component of having the propert to set the text from bottom to top.

waiting for reply.......

 
Marshal
Posts: 63454
207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sandeepshah shah wrote:waiting for reply.......

And you expected a reply within an hour and twenty minutes?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot do that with the default jTextArea. You will have to extend the Class JTextArea. If you mean extracting the contents of a JTextArea, you can use a stack. Please you have to give more details.
 
Sheriff
Posts: 21649
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our GUI forum.
 
Marshal
Posts: 24195
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Raphael is right. You should explain what it means to "set text into a JTextArea from bottom to top".
 
Sandeepesh shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I explain in more detailed what i want to do.

I have a JTextarea of setbounds width=200 and height =50.in which suppose i can write 5 line ok.

but my text generate dynamically it is not sure whether it will fit into 2 line 3 line or more.......

if suppose my dynamic text feet till 3 line and i have the height of Jtextarea is 50 which can hold 5number of line so the last
2 line will remain blank ok/

But i want to set my dynamic text from bottom to top.means all my three line should feet from line number 5,4,3

and my JTextarea will display the above two line blank and the last three line should hold my dynamic text......

for more clearity please check the attachment........

Filename: JtextareaAttachment.bmp
File size: 137 Kbytes
 
Sandeepesh shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In simple way:

String s ="First Line \n"+"Second Line \n"+"Third Line"; // The value of String s would be dynamic.
JTextArea jt = new JTextArea();
jt.setText(s);

please find the attachment
Filename: JtextareaAttachment.bmp
File size: 137 Kbytes
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At run time, figure out how many lines of text you got. Based on that, prepend those many \n to your text and then set it to the text area. You will need to work out the linewrap problem though.
 
Sandeepesh shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's I hope it should work.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sandeepshah shah wrote:


Please check your private messages for an important administrative matter.
 
Rancher
Posts: 3013
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!