开发者

Getting the Java Swing 'No Drag' Cursor

开发者 https://www.devze.com 2022-12-22 08:59 出处:网络
Is it possible to get开发者_运维百科 a reference to Swing \"no Drag \"Cursor ,since it is OS Specific, or maybe override itI think you might be looking for the DragSource class which has bunch of pred

Is it possible to get开发者_运维百科 a reference to Swing "no Drag "Cursor ,since it is OS Specific, or maybe override it


I think you might be looking for the DragSource class which has bunch of predefined cursors.


I would look into java.awt.Toolkit::createCustomCursor if you want a cursor that is not predefined in java.awt.Cursor

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

From the Java 6 Documentation:

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).
Note that multi-frame images are invalid and may cause this method to hang.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号