java - Is there a good way to add a Document Listener to a Dynamically created JTextField -


I am reading information from an XML file where I do not know until I read it. Dynamically creating Jtextfields and information can get to appear on them. I am trying to create a document list in those text areas so that a user can change the data and every time a number changes it will automatically update the XML file. The problem is that there is no reference to JTextField to get the text and it is causing a compiler error, is there any way to do this?

Use the factory style setup.

Actually, make a method or class that will make a JTextField pass the reference to the node that it will be responsible for it.

Create a text field and register it DocumentListener ... However, I have to be careful about using a DocumentListener personally, maybe A ActionListener and / or Focus Listener may be more suitable but may be grass.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -