Link to home
Start Free TrialLog in
Avatar of sarin_ashish
sarin_ashish

asked on

Creating multiple frames in sequence in a for loop

Hi again !!

I was trying to do something like this: I have a JDialog which shows up when a for loop is executing. In the for loop I manipulate the content of the JDialog to show some new content. This JDialog pops-up within the for loop. But when I run the program I see only the last content added to the content pane of JDialog. The reason being the for loop doesnt stop after showing the JDialog. I want the sequence to be maintained. So is there any way in which I can wait within the for loop for the JDialog window to close ?? So that when the user closes the JDialog I continue with the for loop and generate the next JDialog ??

regards
Ashish Sarin
Avatar of CI-Ia0s
CI-Ia0s

Create the dialog separately and have it updated from within the loop. Will that work or does the dialog have to be within the loop? (I'm not exactly sure whether you need to keep creating new dialogs or just updating one dialog...)
Avatar of sarin_ashish

ASKER

I figured out how this can be done. thanks.  I made a modal dialog, in which the method that creates the Dialog returns only after the shown dialog box is disposed.
Sounds good. :)
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial