custom cursor not shown

hi,

i’m trying to create a custom cursor (which obviously succeeds because i don’t get an exception when i create it) but the cursor is not shown in my game.

here’s the code i use:
try {

java.awt.Toolkit toolkit = container.getToolkit();
java.awt.Image image = toolkit.getImage(“img.gif”);
java.awt.Cursor cursor = toolkit.createCustomCursor(image, new java.awt.Point(0,0), “img”);
setCursor(cursor);

} catch (Exception ie) {
ie.printStackTrace();
}

i use BufferStrategy in a JFrame. as soon as the mouse enters the jframe the mouse pointer disappears.
could this be related to the BufferStrategy?

It’s because you’re using toolkit… it’s just not done with loading at the time you’re creating the cursor.

So… either just stop using toolkit’s image loading methods alltogether and use ImageIO (like the rest of us) or use a media tracker.

[quote]It’s because you’re using toolkit… it’s just not done with loading at the time you’re creating the cursor.

So… either just stop using toolkit’s image loading methods alltogether and use ImageIO (like the rest of us) or use a media tracker.
[/quote]
every tutorial i found suggested using the toolkit.
and i did try using the media tracker but nothing changed.
i will give it another try with imageIO, thx for the info.