Java JComponent to Image setCustomCursor(Component component, Image cursorImg, String name)

Here you can find the source of setCustomCursor(Component component, Image cursorImg, String name)

Description

set Custom Cursor

License

Open Source License

Declaration

public static void setCustomCursor(Component component, Image cursorImg, String name) 

Method Source Code

//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);
        }
    }
}

Related

  1. componentToImage(Component component, int resolution)
  2. doScreenshotToFile(final Component container, final Path filePath, final String imageType)
  3. ensureImageLoaded(Component owner, Image image)
  4. findConnectedComponents(int[][] image)
  5. generateImageFileFromComponent(Component component, String filename, String Type)
  6. setImage(Image im, Component c)
  7. tileImage(Image img, Component comp, Graphics g, int x, int y, int width, int height)