Hi all friends,

I am facing problem with changing cursor image I want
to change my cursor image for my website home page for
that I write a applet programme it is running fine
with "appletviewer" command on dos-prompt but when i
call that applet file in html file through applet tag
then browser giving me "error:java.lang.noSuchMethod
found in java.awt.Toolkit 'createCustomCursor()'".I
tried it on IE5,IE5.5 & Netscape4.7 all r giving same
error but I couldn't understand why it is giving me
this error.Can any one plz tell why this error.Iam
using jdk1.2.2 .Any help will be highly appreciated.I
know it is not the right place for putting this
question but I couldn't find appropriate answer of
this question thats why Iam putting this question
here.

Below r my codes:-

Applet file:-
-------------

import java.awt.*;
import java.applet.*;

public class CursorApplet extends Applet {


public void init() {

//load the image with the Media Tracker
MediaTracker tracker = new MediaTracker(this);
Image cursor = getImage(getCodeBase(), "drop.gif");
tracker.addImage(cursor, 1,16,24);

try {
tracker.waitForID(1);
} catch (InterruptedException ie) {
ie.printStackTrace();
}

Cursor cr = null;
//get the toolkit for this environment
Toolkit tk = getToolkit();

try
{
//this is the x,y coordinates of the image which
//will actually do the "clicking"
Point hotSpot = new Point(1, 1);

//create the custom cursor
cr = tk.createCustomCursor(cursor, hotSpot, "drop");
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
//set the cursor for this applet component
setCursor(cr);
}
}
html file:-
-----------
<html>
<head>
<title>An Example</title>
</head>
<body bgcolor="black">
<applet code="CursorApplet.class" width=200
height=200>
</applet>
<body>
</html>

Regards
Bikash



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to