Synchronize JTextFields Values by PropertyChangeListener

后端 未结 6 1091
盖世英雄少女心
盖世英雄少女心 2020-12-19 18:12

I want to copy the value of a jTextField - TXTFLD1 to another jTextField -TXTFLD2 when the value at TXTFLD1 changes.
I choose propertych

6条回答
  •  难免孤独
    2020-12-19 18:55

    DocumentListener yourDocListener=...;
    TXTFLD1.getDocument().addDocumentListener(yourDocListener);
    

提交回复
热议问题