Hello!

There is a lengthy process, the course of which is displayed in a dialogue built on SwingWorker-е . During the process, I need to ask the user something and until he answers the process does not continue. Normal JOptionPane.showConfirmDialog not drawn, and SwingUtilities.invokeLater continues to execute the main thread. If I start these threads to synchronize the circle closes - again, the dialogue with the question is not drawn. Who knows how to win this situation?

    1 answer 1

    Make a static flag. From the stream, poll him.

     public volatile boolean canContinue; run(){ ... while (!XXX.canContinue){ try{Thread.Sleep(10);} catch(ThreadInterruptedException e){} } } 
    • canContinue doesn't quite fit. My question may or may not appear at a certain stage of the work flow. Ie on the progress bar I cannot publish it in advance, additional dialogue is required. - barshay