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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 04:48:53

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!