What Java Listener to use to populate a TextField?

Yep, looking for something like the Open event for a window to populate a control.

I just created a simple Java IntelliJ example where a new window is created, and the textfield is not populated.

Here is a link to download a demonstration example that I quickly created: Download JavaTextField.zip example (JavaTextField)

The file is called JavaTextField.zip, and please unzip it so that the project can be read in IntelliJ IDEA. In the first form, press the Open button, which opens a second form. In the second form there is a couple of labels and a TextField. The textfield ‘should’ update from either of the windowOpen, windowOpened, or formOpen events. I have the TFTest.setText(“propertyChange”) line of code commented out. If the comment is removed, the textField will show the text ‘propertyChange’, and in the console there are four lines of ‘propertyChange’ shown, which means the propertyChange method is called four times when the form is being created.

Thanks for your help.

I am using the following systems:

  • openjdk-16 (java version 16.0.2)
  • Windows 10
  • IntelliJ 2021.1.3 community edition