简体   繁体   English

获得Java Swing'No Drag'光标

[英]Getting the Java Swing 'No Drag' Cursor

是否可以获得对Swing“no Drag”Cursor的引用,因为它是OS特定的,或者可能会覆盖它

我想你可能正在寻找具有大量预定义游标的DragSource类。

I would look into java.awt.Toolkit::createCustomCursor if you want a cursor that is not predefined in java.awt.Cursor 如果你想要一个在java.awt.Cursor中没有预定义的游标,我会查看java.awt.Toolkit :: createCustomCursor

public Cursor createCustomCursor(Image cursor,  
                                 Point hotSpot,  
                                 String name);

From the Java 6 Documentation : Java 6文档

Creates a new custom cursor object. 创建一个新的自定义光标对象。 If the image to display is invalid, the cursor will be hidden (made completely transparent), and the hotspot will be set to (0, 0). 如果要显示的图像无效,则将隐藏光标(使其完全透明),并将热点设置为(0,0)。
Note that multi-frame images are invalid and may cause this method to hang. 请注意,多帧图像无效,可能导致此方法挂起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM