Java – how to get rid of the mouse cursor in full screen exclusive mode?

I am using a simple 2D game engine in Java, and have not encountered fSEM, buffer strategy and other problems; My problem is the mouse cursor In window mode, I can hide the mouse cursor. There is no problem. Set a completely transparent cursor by using setcursor() in my JFrame However, after calling device After setfullscreenwindow (this) enters fSEM, the mouse cursor returns. Later, calling setcursor() to set it back to my blank cursor has no effect Call device Setfullscreenwindow (null) allows me to get rid of the cursor again - I can't get rid of it only when I'm in fSEM

I work under JDK 6, and the target platform is JDK 5

Update: I've done some more tests. It seems that this problem occurs in MacOS X 10.5 w / Java 6u7, but not Windows XP SP3 and Java 6u7 Therefore, it may be an error in the Mac version of the JVM

Solution

Attempt to create a custom invisible cursor:

Toolkit toolkit = Toolkit.getDefaultToolkit();
    Point hotSpot = new Point(0,0);
    BufferedImage cursorImage = new BufferedImage(1,1,BufferedImage.TRANSLUCENT); 
    Cursor invisibleCursor = toolkit.createCustomCursor(cursorImage,hotSpot,"InvisibleCursor");        
    setCursor(invisibleCursor);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>