ciao a tutti ho un problema nel creare un cursore da un'immagine. per crearlo utilizzo la funzione createCustomCursor di jawa.awt.Toolkit ma nn riesco ad accedere alla funzione.

ecco il codice.

Image img=getImage(getCodeBase(),image);
Point p=new Point (2,2);
Cursor cursor;
cursor=Toolkit.createCustomCursor (img,p,"cursor");
setCursor(cursor);

Error(54,22): non-static method createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String) cannot be referenced from a static context

ho provato anche nel seguente modo con lo stesso esito:

Image img=getImage(getCodeBase(),image);
Point p=new Point (2,2);
Cursor cursor;
cursor=java.awt.Toolkit.createCustomCursor (img,p,"cursor");
setCursor(cursor);

che cosa posso fare??? grazie Simone