我想从谷歌浏览器下载栏中拖出一个文件并放入swt应用程序,但我无法删除该文件。 我写了一些代码,但它不适用于chrome,但它适用于mozila firefox。
int operations = DND.DROP_MOVE | DND.DROP_COPY;
Transfer[] types = new Transfer[] {FileTransfer.getInstance()};
DropTarget target = new DropTarget(parent, operations);
target.setTransfer(types);
target.addDropListener(new DropTargetAdapter() {
public void drop(DropTargetEvent event) {
}});