Adjust the appropriate cursor state according to the GUI element covered by the cursor.
Support Java 17 #1