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
Post a Comment