I have a problem with a program in Java and I'd like to know your opinion.
I explain to you:
I have one interface graphical (JFrame) with a button that when it is touched executes a code that realizes a set of tasks.
What I want is that, as the above mentioned code is executed, visualize information about his evolution in the graphical interface.
When I still don't have the interface, it was showing the messages across the exit (with a System.out.println) . But when I have tried to put the interface, the messages do not go out until the whole code has been executed.
My question is: how can I do that messages can be visualized in dynamic way?
You can use threads, a thread for each task, give them low priorities, and a thread with the highest priority to the task that does the visual interface, and then put it in sleep the time that you consider necessary.
Think that with this schema the secondary threads will not execute in a sequencial order,
your tasks musn't depend on the others task, so you don't have problems of synchronization
as Ed says, try with threads.
If you don't know how to use it I can send you a good tutorial
just let me know