After many attempts trying to make a JProgressBar
work as expected, I finally became successful at achieving my goal. I had used @MadProgrammer\'s advice and used a
When you call setCursor()
on the JFrame
, it only has effect for the frame, not the dialog. Similarly, when you call setCursor()
on the JDialog
, it only has effect for the dialog, not the frame. There the problem: you did not set the cursor for the dialog, right?
I'm not sure whether setCursor(null)
is safer than setCursor(Cursor.getDefaultCursor())
. :p
Kudos for creating a modeless dialog and using a worker thread, which will improve the user's experience with decreased perceived latency. Consider adding a MouseListener to the dialog when the worker starts. Display the WAIT_CURSOR
in your implementation of mouseEntered()
, and restore the default in your implementation of mouseExited()
. Remove the listener in done()
. This will make the progress and cursor visual cues coincide when the user's attention shifts to the dialog while the worker is running.