Determining programmatically when window is finished opening

I’m currently executing a long initialization script from the InternalFrameOpened event of the starting screen of my project. I use invokeAsynchronous to run my script on a background thread, and called invokeLater from that, periodically, to push new information to my screen. The problem is that sometimes, the screen updates appear to fire before the window is fully opened.

As a temporary fix, I polled system.gui.getOpenedWindowNames() until I found my window in it, but this seems like a nasty solution.

Is there something I can watch or do to ensure that my updates don’t stomp on the window opening?

What’s even stranger is that it seems like the window is opening twice. Here’s the contents of my console, with some traces that I added.

For reference, the confirmWindowOpen function runs as part of the initialization function, on the background thread. updateSplashText is run using invokeLater on the event-dispatch thread. The client tag information come from a client tag change script.

There is a visionWindowOpened event on the windows now that you can use that won’t be fired until after the window is finished opening (but before the bindings are evaluated).