Changing the default cursor to busy cursor does not work as expected

后端 未结 2 1671
再見小時候
再見小時候 2021-01-27 03:34

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

相关标签:
2条回答
  • 2021-01-27 04:16

    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

    0 讨论(0)
  • 2021-01-27 04:31

    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.

    0 讨论(0)
提交回复
热议问题