• Post Reply Bookmark Topic Watch Topic
  • New Topic

JtextBox input event  RSS feed

 
Sandeep DSouza
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to know if there is any event which is triggered when the some data in entered or changed in a
JTextBox.
can someone please help me with this
Thanks in Advance
sandsouza
 
Venkatesh Chitnis
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sandeep,
A textfield can only handle events if you add Listeners to it.
Do you need anything more specific?
 
Steve Lovelace
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by a "JTextBox", but no matter. All the descendents of JTextComponent tell you about text changes in the same way: by notifying DocumentListeners registered with their contained Document. So what you want to do is create a DocumentListener and add it thusly:
myTextWhatever.getDocument().addDocumentListener(myListener);
 
Sandeep DSouza
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your help .. will try implementing it now
Regards,
sandeep
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!