senzacionale
senzacionale

Reputation: 20936

ontextchanged event in java

i am looking al events in java http://java.sun.com/docs/books/tutorial/uiswing/events/handling.html

i want ontextchanged event like in C# that when text changed event is executed. Which event is the right one in java?

Upvotes: 0

Views: 1243

Answers (1)

Riduidel
Riduidel

Reputation: 22308

First, you should say which Swing widget you're looking at,a s behaviour is quite different. But, to make long things short, here is a primer.

Most of text widgets use, internally, a model which is a Document. This Document is updated by the widget and sends, in turn, Document events. So, to listen text change whichever widget you use, you can create a DocumentListener.

I also suggest you take a look at some lessons of the Swing tutorial :

Upvotes: 1

Related Questions