I have jPanel1 that contains jTextField1 and addButton. addButton adding dynamic tf to jPanel2. Finally by saveButton retrieving their values and saving to text file. Now I am adding DocumentListener to each jTextField using this code:
And it works well with jTextField1, but it doesn't work for dynamically added tf.
I would like to ask how can I implement DocumentListener for dynamically added tf.
Any help is really appreciated.
Sorry for long delay. Due to other stuff this problem was waiting own solution for a time. Just now I could return to this problem and quickly found where I was mistaken. Solution was so simple. I just moved addDocumentListener to SubPanel, it solved my problem.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop