[java] Mouse Pointer

Started by
6 comments, last by styrpe 20 years, 4 months ago
I''m a java noob.Well the thing is this.I am making OpenGL apps in java.I have manage to get GL apps running successfully in fullscreen exclusive mode.Now my simple question is.How can I make the mouse pointer disappear!!!!?????
Watamerigonsu
Advertisement
Well, in C++ (or VB for the same matter of fact) I would have known...
That''s:
ShowCursor(false); 


I''m not into Java, but maybe you can try that. Or do a search in the Java tutorials...


Creator of: Science Fiction Career
Percent finnished: 0.1%

Site: http://www.nightsoftware.com/scificareer
Forum: comming soon
Thanks for the help.I used to do my GL programming in c++ and aware of that function.But Java is all about the classes.I tried to look for a mouse class ,but all the mouse classes are use for events.Tried looking in the JFrame class,no success either.I even tried looking in the graphicsdevice class.Like I said,I''m a Java noob.Took me all day trying to compile and run GL apps in JBuilder9,just missing the mouse part.Thanks for the help anyway.
Watamerigonsu
It depends on the library you''re using, is it LWJGL, Jogl or something different?

LWJGL has its own mouse routines (should be some examples in the test cases) where you either draw your own on the GL window or use a hardware-accelerated one.

Jogl uses standard Java cursor methods, so have a look for the tutorials and documentation around java.sun.com
I''m using gl4java.I''ll try looking at it.But with normal Java,I think there must be a way.Cause with C++ ,the windows api is the one in charge of hiding the mouse.
Watamerigonsu
I don''t know exactly where, but you can change the mouse (to an image) and if you just give the name of an image that doesnt exist, your mouse will dissapear. I don''t know which class it is, I have to check that later. (gotta go to school in a few minutes )

Have you tried Sun''s site? java.sun.com

Wesley
Have a nice dayWesley
That''s the funny part.I did a GUI for Postgresql in linux.And I saw the mouse icon property somewhere and don''t remember exactly where I saw it.I was looking for it.I was searching in the Java sdk documentation and don''t no where to find it.The sad part is..when I don''t need it,I''ll find it.But I won''t give up.I came through all this GL thingy,and not knowing how to make the mouse disappear.That''s not acceptable,can''t do the easy part.Thanks all,for the help.I''ll try the mouse icon idea.
Watamerigonsu
Try Componnent.setCursor(Toolkit.createCustomMouseCursor("", new Point(0, 0), "i am an invisible cursor!"));. I think that works. Of course the mouse cursor still moves around, it''s just invisible. If you still want mouse input you have to use Robot.mouseMove() to keep it in the center. LWJGL would probably be easier...

This topic is closed to new replies.

Advertisement