That's because you are not letting FrameA finish it's construction process, you're interrupting it and then in the same thread displaying those two other frames.
I would suggest to change your strategy and use a factory method and probably in conjunction with SwingUtilities.invokeLater method.
Let say you have something like:
public static void main( String [] args ) {
JFrame a = new FrameA(); // Has both display logic and trial "pop up" logic
}
Change it for:
public static void main( String [] args ) {
JKFrame a = FrameA.createFrame(); // the same but splited like the following code
}
class FrameA extends JFrame {
// new method
public static JFrame createFrame() {
return new FrameA();
}
}
Nothing changed you just added the factory method, later you can:
public static JFrame createFrame() {
if( thatSpecialLogicSaysItIsTrialAndShouldPopUp() ) {
JFrame b = new FrameB();
b.setVisible( true );
JFrame c = new FrameC();
c.setVisible( true );
return new FrameA();
} else {
return new FrameA();
}
}
What you will be doing in the second code is separate the logic from the class constructor and put it in the factory method. That way if thatSpecialLogicSaysItIsTrialAndShouldPopUp returns true, you display B and C
You can also as described use a JDialog there, but pretty much the problems will be gone when you separate the responsabilities.