• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

TextArea problem

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working with text area and having following requirement
1).only 80 char should be in each line.
2). after completion of 80 char caret should move to new line.
3). and one more point if 78th char is space and next word having 5 char so total count of char of line will be more than 80 char so this word should be in next line.

does anyone has done this before. looking for response.
 
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
Didnt you see This ? Its practically the 7th post before yours!
 
prashant gour
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I saw it and did follow all given suggestions but that doesn't work for me.
will you come up with solutions rather than redirecting the post.

i hope, Text area's API are not just enough to do this things. looking for another solution.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you read this?: http://java.sun.com/docs/books/tutorial/uiswing/components/text.html

it can give you a good overview what can be done with the text components.
note: if there are text editors where you can set how many characters should a line/row have, then there has to be a way
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got to ask... how is your need different than that you can get by simply turning on line- and word-wrapping in your textarea (and in the constructor, setting it to a width of 80 characters)?

Also, are you working with an AWT TextArea or a Swing JTextArea?
 
Do not threaten THIS beaver! Not even with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic