Here you can find the source of setCustomCursor(Component component, Image cursorImg, String name)
public static void setCustomCursor(Component component, Image cursorImg, String name)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { public static void setCustomCursor(Component component, Image cursorImg, String name) { setCustomCursor(component, cursorImg, new Point(0, 0), name); }/*from w w w .j av a 2 s . c o m*/ public static void setCustomCursor(Component component, Image cursorImg, Point hotSpot, String name) { Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(cursorImg, hotSpot, name); if (cursor != null) { component.setCursor(cursor); } } }