DragNDrop从Java到Windows资源管理器 [英] DragNDrop from Java to Windows Explorer

查看:117
本文介绍了DragNDrop从Java到Windows资源管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Java中创建一个列出目录的应用程序,并为其添加拖放支持,以将文件从该目录复制到打开的资源管理器窗口(反之亦然)(Windows系统)。



从Windows资源管理器到java应用程序的添加支持相当容易,但是当我从java应用程序启动并以资源管理器结束时,这种方式让我无法做到这一点。 p>

我尝试搜索google和SO,但无济于事。



任何指针,方向,代码片段或伪代码将不胜感激。



那么,是否可以从java应用程序中拖动并将数据传输到本机应用程序中的放置目标?如果是(应该是),你可以指向正确的方向吗?

解决方案

只需使用 fileListFlavour DataFlavour和File drag'n drop将



我确定你找到了部分在java教程中的拖放


I want to create an application in Java that lists a directory and add drag and drop support to it for copying files from that directory to the explorer window opened and vice-versa(Windows system).

While adding support to drag and drop from windows explorer to the java application is quite easy, it kind of eludes me how to do it when the action starts from the java application and ends in explorer.

I tried searching google and SO, but to no avail.

Any pointers, directions, snippets of codes or pseudocodes will be appreciated.

So, is it possible to drag from a java application and transfer data to a drop target in a native application? If yes (it should be), can you point me in the right direction?

解决方案

Just use the fileListFlavour DataFlavour and File drag'n drop will "just work" in both directions.

I'm sure you found the section on drag n drop in the java tutorial.

这篇关于DragNDrop从Java到Windows资源管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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