I developed a Java application for creating and extracting an archive - like WinRAR. You can create several archives at the same time with multithreading. And recently, I wanted to add an information status during the archive creation in the form of JProgressBar in a new JFrame at every creation.
But my problem is generating information in the new status frame and the thread which create the archive. That's why I create the JFrame in the archive thread for updating the progress bar currently.
But like I could read it in a diverse information source and on your answers/comments, it's against Java Swing and performance; I can't create swing object elsewhere that the EDT.
But then, how should I solve my problem? How can I etablish communication between the writing of my archive and its status JFrame (with JProgressBar)?
EDIT:
I implemented SwingWorker to manage the GUI in my application. Now it's done, I have an other question:
With SwingWorker, how do I act on the background task with an event on status Frame's button? (Example: pause compression or stop it.)