- all updates to already visible AWT/Swing GUI must be on EDT
- you can to prepare whole GUI out-off EDT, but setVisible and apply LayoutManager must be on EDT, wraped in invokaLater
Everything must be done on the EDT, see the concurrency chapter in the tutorial:
almost all code that creates or interacts with Swing components must run on the event dispatch thread. [..] Some Swing component methods are labelled "thread safe" in the API specification; these can be safely invoked from any thread. All other Swing component methods must be invoked from the event dispatch thread.
So why exactly is the creation "heavy"? Try to profile and then separate out non-ui stuff (which I wildly assume will turn out as the bottleneck, haven't seen a view with perciptible performance impact in years)
@mKorbel: you know that this "safe-before-realized" is an outdated myth, why do you repeat it?
@Kleopatra: hehehe why, I think than not out_dated, everything is about to simulating CardLayout and wrong way
in Java7 aren't thread safe JComponents or its methods, everything changed, JTextComponents too