What Java Listener to populate a textField in a new Form?
What Java Listener should be used when populating a textField in a new form with data?
When a second form is created, I have attempted to used windowOpen, windowOpened, and formOpen, and it seems like the textfield control has not been drawn yet, since setting the text on a textField control does not update the control.
TFISBNtmp.setText("windowOpen");
System.out.println(“windowOpen”);
When I run the above code in either of the two Listeners (windowOpened, windowOpening), the textField (TFSIBNtmp) does not show the text in 'windowOpen' listener method, and the println does show text in the IntelliJ IDEA IDE, which means the event is firing.
Here is a link to a demonstration example that I quickly created. Download the JavaTextField.zip example: https://www.mediafire.com/file/oayupxpkx4jkus3/JavaTextField.zip/file
Run FirstForm and press the Open button, which opens a second form with a textField. The SecondForm code attempts to populate the textField with code in the windowOpened, windowOpen, and formOpen events.
It seems like the form has not created or made the textField available to allow the setText command to work. What Java Listener can I use to populate a textField in a new Form with IntelliJ?
Thanks! :)
Please sign in to leave a comment.
This question is hardly related to the IDE, so it is better to ask this question on StackOverflow.
Hello Konstantin,
My apologies, as this is highly specific to the IntelliJ IDEA IDE. My wild guess (and thats all it is) is the following:
I have asked this question on other sites, but not StackOverflow. The consensus is to use Eclipse, as support for IntelliJ is lacking. I understand this comment from your response.
I will consider your comment as the answer.
Warm regards.