I have a JButton
(swing
) in the JPanel
, where if it is pressed I am performing a task on the for loop over the list in its EDT thread
. While doing so I need to update the JProgressBar
.
Problem is, when I am pressing the JButton the task is performed in Event Dispatch Thread (EDT). So I can't update the JProgressBar
which is triggered either in main or UI thread.
Right now the source code is not available at me as I completely changed it and tried to use Eclipse SWT for JProgressBar
when that Swing JButton
is triggered, it becomes messy.
Now I got invalid thread access
error, as the Display object runs in separate UI thread. At a time, only either a Swing JPanel
or Eclipse SWT Shell
gets displayed.
I am triggering JPanel
using JOptionPane
.