I have created a GUI having one JButton
and some other components. When I click the button, some back end processing is involved which takes nearly 10-12seconds.
How should I represent it graphically?
I have created a GUI having one JButton
and some other components. When I click the button, some back end processing is involved which takes nearly 10-12seconds.
How should I represent it graphically?
Use a JProgressBar
for displaying the progress of the task.
Put it inside a non-modal dialog that has a 'cancel' button (if the long running operation can safely be cancelled).
Be sure to obey the rules of the EDT by performing the long running task 'off the EDT', while the updates to the progress bar are done 'on the EDT'. The SwingWorker
offers easy access to both.