Appologies in advance for not having some real code to look at but hopefully my pseudo code will be enough to illustrate what the problem is.
I have a MDI application and in this particular scenario a JInternalFrame called AAAA creates an instance of another JInternalFrame called BBBB.
In the constructor for BBBB all the Swing layout and controls are drawn and only when the screen is complete does it execute a rather lengthy SQL SELECT to populate a JTable.
The problem I have is that because Swing is doing its screen painting in its own thread it does not have time to draw the BBBB frame before the SQL SELECT fires up and consumes all the spare CPU cycles.
This means that the BBBB frame simply does not appear at all until the query has completed.
I have tried inserting some delays / pauses at strategic points without luck.
Is there something I can put in the constructor of BBBB after the screen has been defined, but before the SQL is executed which will force Java to paint the screen..