Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: how can i implement the method createCustomCursor Posted by pah on 14 Mar 2007 at 5:02 AM
: : SO if you want a custom cursor you can create a curor with the
: : toolkit class
: :
: : java.awt.Toolkit.getDeafaultToolkit().createCustomCursor(Image cursor,Point hotSpot,String name);
: :
: :
: : cursor --> the image to display when the cursor is activated
: :
: : hotSpot --> the x and y of the large curors hot spot;
: : the hotspot values must be less than the dimension returned by getBestCursorSize

: :
: : naem --> a localized description of the cursor, for JAVA Accessibility use
: :
:
:
: doesnt work, thats why i ask anyone to implement that method into an easy applet. i thank you for all you did (you are the firt one who ever replie to me) tkx
:

ImageIcon icon = new ImageIcon("[FOLDER]/[FILENAME].gif");
Image a = icon.getImage();

final java.awt.Cursor myCursor =
java.awt.Toolkit.getDefaultToolkit().createCustomCursor(a,new java.awt.Point(8,8),"test");

setCursor(myCursor);


This should work also with a applet!?
The only problem which you should have is to recive or to bundle the image into the applet....so the server should send the applet the picture or you have to bundle the image in the applet then the [FOLDER]/[FILE].* paraemter looks different




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.