I would ask something about my project. I have a Java program that connects to a website through a Connection class that takes as parameter an int. This class has only a method that return an ArrayList (it gets informations from a web page , and puts results in an arraylist).
In the Main I have a for loop:
for(int i=0;i<insertUserNumber; i++){}
Inside this loop I invoke a Connection object that gets as parameter the "i" of loop and when the object returns the ArrayList, I take it, do something with it and show the result inside a JOptionPane.
The problem is that ONLY when i click on OK i see the other JOptionPane with the result of operation did in the loop. I wish to see them at the same time so I could see all data.
From Javadoc
All dialogs are modal. Each showXxxDialog method blocks the caller until the user's interaction is complete.
So how can I resolve the problem?
1)Is using multithreading a good solution or there are better ones ?
2) is there a way where I can refresh automatically data of the JoptionPane without start the program?
Thanks and sorry for my bad english.