I need to create cursor with transparent(watermark) image, ie if I moving cursor under for example some text I need to see that text, can somebody help me with that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
To create a custom cursor, use the java.awt.Toolkit.createCustomCursor
method.
回答2:
public Cursor pointer() throws Exception { int[] pixels = new int[16 * 16]; Image image = Toolkit.getDefaultToolkit().createImage( new MemoryImageSource(16, 16, pixels, 0, 16)); Cursor transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor( image, new Point(0, 0), "invisibleCursor"); return transparentCursor; }