java - Typing into a JTextField enables a button. Is it wrong to use a KeyListener? -


i have button called "save changes" save changes if changes detected in jtextfield component. now, assume if user types anything, content has changed.

i using keylistener, this question sounds using other actionlistener wrong?

you can add documentlistener document of jtextfield. actionlistener gets called when used presses enter. advantage of using document listener can detect changes made other means typing.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -