drag-and-drop

Drag and Drop file path to Java Swing JTextField

╄→гoц情女王★ 提交于 2019-12-09 10:46:32
问题 Using this question, I created the class below, which handles drag and drop of files to a JTextField. The point of the application is to be able to drag a file into the text field, and have the text field's text set to the file's path (you can see the goal in the code pretty clearly). My problem is the below code does not compile. The compilation error states Cannot refer to non-final variable myPanel inside an inner class defined in a different method . I haven't worked much with inner

IOS: drag and drop imageview from a scrollview to a view [duplicate]

a 夏天 提交于 2019-12-09 07:05:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: how to drag an uiimage from scrollview to another uiimageview in iphone sdk In my iPad I have a view and inside it, on the left, I have a scrollview with 10 imageViews; so I should drag and drop these images from scrollview to my big subview; how can I do it? 回答1: I did something like what you are describing once. I remember to pull it off I created a new UIGestureRecgonizer that I dubbed

dataTransfer is null when creating drag event programmatically

吃可爱长大的小学妹 提交于 2019-12-09 03:09:24
问题 I am trying to create a dragEvent and fire it programmatically using this code on Chrome: var ev = document.createEvent("MouseEvents"); ev.initEvent("dragstart"); and then fire it this way: element.dispatchEvent(ev); The element has draggable attribute. The event was dispatched successfully. However on the event being fired - the dataTransfer object is null. Even when I try to set it manually to a working dataTransfer object - it still stays null. Any ideas? Thanks 回答1: Unfortunately, it

Can't get JQuery Draggable plugin to work?

人盡茶涼 提交于 2019-12-09 01:33:19
问题 I'm very new to JQuery and I'm trying to create a sample page using the Draggable plugin. The page loads fine, but I'm not able to drag my <div> tag anywhere. I've been trying to copy this demo. Here is my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <style type="text/css"> #draggable { width: 150px; height: 150px; padding: 0.5em

How to Attach Drag & Drop Event Listeners to a React component

一个人想着一个人 提交于 2019-12-09 00:34:34
问题 I'm building a component that allows local files to be dragged and dropped on a div. Then there's an output of information about the dropped file. My problem is I don't know how to properly attach the event listeners drop and dragover when creating my component. My App component is where all where all my logic is (handler for drop and dragover) and I created a separate component where files will be dropped on - dropZone component. I tried putting the event listener on the dropZone tag on my

QTreeWidget reordering child items by dragging

妖精的绣舞 提交于 2019-12-08 20:23:24
问题 I have a QTreeWidget which displays a single root node and one level of child nodes only. I need to permit the re-ordering of the child nodes. They must never be re-parented. This is how I enable the dragging of items in the QTreeWidget : ui->levelElements->setSelectionMode(QAbstractItemView::SingleSelection); ui->levelElements->setDragEnabled(true); ui->levelElements->viewport()->setAcceptDrops(true); ui->levelElements->setDropIndicatorShown(true); ui->levelElements->setDragDropMode

Only drop to element that is seen

感情迁移 提交于 2019-12-08 19:36:08
问题 I have the following: I am trying to set it up so that when you drag the item, it only gets dropped to the div element which you can see, and is not covered up. So I used this js: $(".draggable").draggable({ helper: "clone" }) $("#bottom, .draggable").droppable({ drop: function(event, ui) { var $this = $(this), $dragged = $(ui.draggable); $this.append($dragged.clone()); }, hoverClass: "dragHover" })​ But it drops the element in both places even though only one of the drop zones is not visible

Drag and drop into file input doesn't work in IE11

我的未来我决定 提交于 2019-12-08 18:16:56
问题 Can anybody answer me: why drag and drop field works fine in chrome and firefox but doesn't work in IE11? IE11 just open the files when I drag and drop them from the desktop. IE version: 11.545.10586.0 HTML: <input type="file" /> Example: https://jsfiddle.net/3hc2grcp/. 回答1: Internet explorer doesn't support drag and drop API of html5 . so you need some kind of library extension. you must use javascript library such as Dropzone.js. Dropzone.js support drag and drop for files(multiple files

C# Drag and Drop - e.Data.GetData using a base class

你离开我真会死。 提交于 2019-12-08 17:21:09
问题 I am using C# and Winforms 3.5 I have a list of user controls all derived from one base class. These controls can be added to various panels and I'm trying to implement the drag-drop functionality, the problem I'm running in to is on the DragDrop event. For DragEventArgs e.Data.GetData(typeof(baseClass)) doesn't work. It wants: e.Data.GetData(typeof(derivedClass1)) e.Data.GetData(typeof(derivedClass2)) etc... Is there a way I can get around this, or a better way to architect it? 回答1: You can

Unable to drag and drop to Eclipse

不问归期 提交于 2019-12-08 16:29:47
问题 I have been draging and dropping from Windows Explorer to Eclipse since I've started using it, and now find myself unable to do so. When I drag a .java file over my package, the mouse cursor stays a circle with a diagonal bar through it and dropping does nothing. I have tried to change my workspace, create a fresh new workspace, deleted eclipse and redownloaded it. It still doesn't work. Making Eclipse run as admin doesn't solve the issue either. 回答1: I figured out it was due to viewing the