How can I print system.out.print message into a JOptionPane.ShowMessageDialog I need it to run through the for loop and then outside the for loop I need it to display inside of
Set the printer used by 'System.out' with your own. Either redirect to a string writer or create your own Printer implementation and use it instead to collect all the printed output in a 'StringBuilder'. Once outside of the loop take the collected 'String' and display it on the dialog.
I would recommend against using 'System.out.println' altlogether, but I assume you have no other choice.