Mouse Pointer

Hey ive been searching the net for quite some time but i didnt find an answer so let me ask it here
is there a way to set the cursor size?

I have craeted a custom cursor by using the toolkit but it resizes my image because it is to big (62x36 pix)
But i want it to be full scale the image used as pointer so how can i do this?

thx

Cursors are very OS specific things. In many operating systems they’re automatically overlayed onto the VGA signal by the video card. This causes the pointer to be restricted in its size. Windows, IIRC, uses a 32x32px cursor. Your cursor size needs to match that. If it’s of a different size, I believe the OS will automatically stretch it. I don’t know what size you need for Mac OS X, but I do know that it’s a bit finicky about custom cursors.

So in short? No.

you can just hide the cursor (set the cursor to a transparent BufferedImage) and then have your custom image move with the mouse’s coordinates …

any idea how? with an extra internal frame ? (i work with desktoppane and internalframes)

The cursor size is set by the hardware/OS.

As others say, the only way around this is to take over drawing the cursor as part of your game rendering. This means taking control of ALL rendering in your app’s window, so forget about Swing components.

(Actually you can TRY to use Swing components with active rendering by turning their automatic rendering off and manually calling their paint() methods as appropriate but thats a whole lot of work to get right and may never do quite what you want. I’ve had only minimal success doing this myself and with display’s a lot less compelx thne it sounds like yours is.)

Since this sounds like very much a Swing GUI app I’d say either:
(a) Reset cursor size from your OS if it and your hardware allow it (and no I cant tel lyou how to do that you’ll have to go looking through your particular OS’s control panels.)

(b) Give it up as a bad job.

Try using the “GlassPane” if you do use Swing.