Results 1 to 4 of 4
Thread: addTextListner
- 02-18-2009, 03:30 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 44
- Rep Power
- 0
addTextListener
Hi
Does anyone know the appropriate syntax for a TextListener. I am trying to add a textListener to a JTextArea but keep getting the following error message:-
ATM.java:75: cannot find symbol
symbol : method addTextListener()
location: class javax.swing.JTextArea
displayArea.addTextListener();
Any help would be appreciated. I have the addTextListner method within my class, so I dont think this is causing a problem.
Sincerely
theLinuxGuyLast edited by thelinuxguy; 02-18-2009 at 04:27 PM. Reason: title mispelling
-
are you sure you didn't mean addDocumentListener? There's no such thing as a textlistener or an addTextListener method for JTextArea.
When in doubt, read the API.
- 02-18-2009, 07:58 PM #3
Member
- Join Date
- Dec 2008
- Posts
- 44
- Rep Power
- 0
addTextListener()
Hi Fubarable
Thanks for the reply. I did mean TextListener, it is listed on page 335 of sams teach yourself java 6, and on some sites that I have looked at. I will look at addDocumentListener(), it might be helpful.
Thanks
Kind Regards
theLinuxGuy
-
I don't doubt that page 335 mentions this, but are you sure that it mentions it in reference to JTextAreas? I think that you may be mixing up Swing and AWT here as TextListeners are used with the AWT component TextArea but not with the Swing component JTextArea. Right now I'm standing by your need to use a DocumentListener here not a TextListener, but please look at the fine print of that article and get back to me if I'm wrong.
Last edited by Fubarable; 02-18-2009 at 11:45 PM.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks