I developed a Java application for creating and extracting an archive - for example WinRAR . You can create multiple archives at the same time using multithreading. And recently, I wanted to add the status of the information during the creation of the archive as a JProgressBar in the new JFrame with each creation.
But my problem is to generate information in a new state frame and the stream that the archive creates. Therefore, I create a JFrame in the archive stream to update the current progress bar.
But, as I could read it in a varied source of information and your answers / comments, it is against Java Swing and performance; I cannot create a swing object elsewhere that EDT .
But then, how should I solve my problem? How can I establish a connection between the writing of my archive and its JFrame status (with JProgressBar)?
EDIT:
I used SwingWorker to control the GUI in my application. Now everything, I have another question:
With SwingWorker, how do I work on a background task with an event on the status of a Frame button? (Example: pause compression or stop it.)
damson
source share