The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Custom Cursors

Posted by Danny on September 04, 2001 at 8:23 AM

I don't know if this is what you're after, but this code will use a GIF image and make a cursor out of it. This code is called within init() in my applet.

try
{
ImageIcon magimageicon = new ImageIcon(new URL(mydir + "/images/magcursor.gif"));
Image tmpimage = magimageicon.getImage();
Toolkit tk = getToolkit();
magcursor = tk.createCustomCursor(tmpimage, new Point(0,0), "Mag Cursor");

}
catch (Exception e)
{
System.out.println("Failed to create mag cursor :- " + e);
}




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us