Jtextfield and keylistener

后端 未结 2 888
庸人自扰
庸人自扰 2020-12-04 04:06

I have a jtextfield (jt) where I want as soon as the user types \"e\" for example in it, the word \"Example\" to be written automatically in the jt

2条回答
  •  囚心锁ツ
    2020-12-04 04:26

    You can move your jt.setText("Example"); into the public void keyReleased(KeyEvent e) of your KeyListener

提交回复
热议问题