Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to do This ? its urgent pls  RSS feed

 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
i want to use TextArea and i want to get the word
which is just behind current cursor position
FOR EXAMPLE
Hi How are you|
suppose my cursor after "you" word how can get this word and this i want ot do for evry word which is typed in my TextArea
if it is not possible with TextArea then suggest me another way to do this
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's one way I found to do it...



-nate
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx alot for ur reply:
But hte only problem with this is i have to press button and then i can get that word which is next to caret position.i want same this without doing any other action means i dont want user intervantion or u can say i want these continues words while typing because at the same time i want to compare current word with my own word list which in different file or in string array.
and suggestion then pls reply me back
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replace the ActionListener with a TextListener, hook the TextListener to the text area, and remove the button...



-Nate
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!