Colorful custom cursor support for Java XAWT (AWT/X11)
- Add the Maven Central repository (if not exist) to your build file:
repositories {
...
mavenCentral()
}
- Add the dependency:
dependencies {
...
implementation 'com.tianscar.awt.x11:colorful-xcursor:1.1.2'
}
Add the following lines to the JVM args:
--add-exports java.desktop/sun.awt=ALL-UNNAMED
--add-exports java.desktop/sun.awt.X11=ALL-UNNAMED
Cursor imageCursor = ColorfulXCursor.createImageCursor(Image cursor, Point hotSpot, String name);
Cursor fontCursor = ColorfulXCursor.getFontCursor(int type);
Cursor libraryCursor = ColorfulXCursor.getLibraryCursor(String name);
MIT (c) Karstian Lee
pencils.jpg is cropped from https://en.wikipedia.org/wiki/Color#/media/File:Colouring_pencils.jpg, the source image licensed under CC-BY-SA.