Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

How to set the text in JTextarea from bottom.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79642
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to our GUI forum.
 
Marshal
Posts: 28289
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank's I hope it should work.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sandeepshah shah wrote:


Please check your private messages for an important administrative matter.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic