What Java Listener to use to populate a TextField?

Between run and set visible you can fill it

Finding a compromise: building up a public static form_open() method and call it from the forms Main. Build in every form class a Main where the form is builded up and fill the form with the open method. That would be Java conform to best practices and not need an Action event which is anyhow not needed for it. Form open fires exactly one time: when it is called.

That’s what I was writing inside the Main and not the invoke later stuff. You can do both. But what ever, in all cases it will work

I do think that once you’ve use Xojo for so long you forget that you CAN set things after the initializer & do not need to rely one some other mechanism, effectively the “open” event in Xojo, to set data into the newly created instance

When you setup a Frame you can du anything what you could and would do in an open event also there. You can also → if you want to → setup an own open method after the pack(); command. So you’ll have the same like with an open event. But you have the full control about all stuffs you’re doing in the form when opening, you could also do it with different arguments to the main so you would have different fillings of the form. it is MUCH more flexible than the Open Event.

I am attempting to populate a TextField on a second form with IntelliJ IDEA. Unfortunately, adding setText inbetween run and set visible does not seem to work. It seems like intelliJ creates/updates the form after the code has run.

Here is code for the FirstForm, and the xml of the FirstForm:

Here is the code for the SecondForm, which is where I want to update the TextField as it is being opened:

The reason why I am asking for a Listener to populate a TextField, is that the traditional method of adding data in the form object, doesn’t appear to update the Textfield. It seems like it might be specifically with IntelliJ.

First of all: please use Netbeans with it’s designer or IntelliJ with JFormdesigner. The IntelliJ Designer is the biggest #+*?=&%$§ you ever saw. I hate it.

Second: in this project here you can see it working without all that … !

Did you tried with making the Button static? Should work then. In my IDE it makes immediately an error message.

But again: DO NOT USE IDE’s Form Designer. It is the last thing you can use. It is only for EMERGENCY and even then I would prefer coding by Hand. Don’t do it. That’s why I show in my tutorials ALWAYS JFormdesigner. Please use that while it makes really less stress.

I promise you: I can do that here WITHOUT ANY Window Event and WITHOUT any OPEN or anything else event except the Button Action event.

As long as the Loader isn’t static it defines only a new instance of the window. Make it static like your psvm also