Fiddly Ant gymnastics to avoid building the app twice
No need to use invokeLater here - works fine without it. And without it, no flickering.