• Post Reply Bookmark Topic Watch Topic
  • New Topic

does a JTextArea need some event listener?

 
Clayton Cramer
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can get my applet to display text passed to it fine, but if I make changes in the JTextArea, when I hit the OK button, getSelectedText() returns nothing--not even the text that I put into it at the start. My guess is that there is something equivalent to an actionlistener (although it isn't that for JTextArea) that takes some action on the text.



 
Clayton Cramer
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getSelectedText returns only that text you selected; getText is the method that I needed.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!