This site requires JavaScript, please enable it in your browser!
Greenfoot back
Advenging
Advenging wrote ...

2011/8/2

How can I fade out the mouse crusor ?

Advenging Advenging

2011/8/2

#
I have google my problem and found this code : setCursor(java.awt.Toolkit.getDefaultToolkit().createCustomCursor(new BufferedImage(1,1,BufferedImage.TYPE_4BYTE_ABGR),new java.awt.Point(0,0),"NOCURSOR")); But in Greenfoot comes the exception can not find symbol - class BufferedImage. Why ? I either can solve this problem with the greenfoot api ? Thx for yours answers. Advenging
kiarocks kiarocks

2011/8/2

#
is it possible you need to import the class?
import java.awt.image.*;
Advenging Advenging

2011/8/4

#
Thx for your answer kiarocks. Im a real noob in java at the moment.But learning by doing helps sometimes. But just come the exception cannot find symbol-method setCursor(java.awt.Cursor). Altough i have import java.awt.Cursor. What is the false ? Thx for yours answers. Advenging
mjrb4 mjrb4

2011/8/4

#
The setCursor method works on a Component (i.e. the Component class in swing) not any Greenfoot classes. You don't have access to these underlying swing classes so unfortunately you can't do what you describe using the above approach. You could potentially have an actor that follows the mouse around and acts as a mouse cursor, and fade that out - though you'd still have the cursor on top!
Advenging Advenging

2011/8/5

#
aaah ok. Thx mjrb4 for your answer.
You need to login to post a reply.