通过将JavaFX与拖放一起使用,是否有可能使被拖动对象的重影跟随光标? [英] Using JavaFX with drag and drop, is it possible to have a ghost of the dragged object follow the cursor?

查看:81
本文介绍了通过将JavaFX与拖放一起使用,是否有可能使被拖动对象的重影跟随光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找Java拖放的示例,但它们始终使用通用鼠标光标并带有框来表示正在拖动项目,而许多工具(甚至是Firefox之类的浏览器)却附加了将对象拖动到光标以指示要拖动的对象。可以在JavaFX中完成吗?

I have been looking for examples of Drag and Drop with Java but they always use a generic mouse cursor with a box attached to indicate an item is being dragged, whereas many tools (even browsers like Firefox) instead attach a ghost of the dragged object to the cursor to indicate what is being dragged. Can this be done in JavaFX?

推荐答案

是的,您可以设置拖动视图(任意图像)拖放操作。

Yes you can set a drag view (arbitrary image) for a drag and drop operation.

这篇关于通过将JavaFX与拖放一起使用,是否有可能使被拖动对象的重影跟随光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆