Research Log of Web Science Students

Computer Science is not simply programming

Custom Cursor

leave a comment »

One suggestion for our game is to change the cursor with an image.  So, I looked for suggestions in the internet and I found one which worked.  My partner and I learned something new from this.  When toolkitObject.getImage(“imageFile”) is used, it will work, yes, but the console will print exceptions along the lines of IndexOutOfBoundsException.  Rather, Java wanted an ImageIcon object first then, get the Image via imageIconObject.getImage() call.  Then, we can now safely use createCustomCursor() from the Toolkit class. 😀

Next, we experimented with GIF images.  By GIF images we really mean the moving images (because there are GIF images that are not moving).  It was not working, the cursor does not change at all.  My partner thought that we have to use sprites(?).  Hehe.  But for the mean time, we decided to just use an appropriate PNG file. 😀


Written by Angelica Gomez

August 19, 2009 at 6:10 am

Posted in MyMathVentures

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: