The Artima Developer Community
Sponsored Link

Java Answers Forum
TextListener for JTextArea ???

1 reply on 1 page. Most recent reply: Mar 21, 2002 6:32 AM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Devin Henderson

Posts: 1
Nickname: devhen
Registered: Mar, 2002

TextListener for JTextArea ??? Posted: Mar 21, 2002 2:38 AM
Reply to this message Reply
Advertisement
I have a GUI with a JTextArea which I store the contents of text files in. I want to listener for text changes in the JTextArea so that I know whether or not to ask the user if he wants to save changes to the file. JTextArea doesn't have an addTextListener() method. How should I do this? Thanks.

Devin


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: TextListener for JTextArea ??? Posted: Mar 21, 2002 6:32 AM
Reply to this message Reply
You can use document listener for JTextArea.
your_JTextArea.getDocument().addDocumentListener( your_Document_listener);

Thanks
Kishori

Flat View: This topic has 1 reply on 1 page
Topic: Exception while trying to read a file from applets Previous Topic   Next Topic Topic: String to char... or another feasable solution

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use