drag-and-drop

Java drag and drop images in a list

孤街浪徒 提交于 2019-12-21 04:18:11
问题 I am looking for a way to display a series of pictures (JPanels with image and maybe some other small components), in a horizontal sequence. The user should be able to rearrange the order of the images, by drag and drop. How do I do this? Is JList with some custom components and D&D the way to go? Some issues to think about (having the components the same dimension increases performance I've heard). 回答1: The following example shows you how to show images horizontally in a list and use drag &

Drag & Drop - DataTransfer object

十年热恋 提交于 2019-12-21 04:12:23
问题 I'm building a simple drag n' drop uploader and I'm wondering why I can't see the file(s) I drop when I console.log(e) (DragEvent) and look at the DragEvent.dataTransfer.files it shows up empty, but... if I console.log(e.dataTransfer.files) it will show the dropped file(s). //CODE <!DOCTYPE html> <html> <head> <script> document.addEventListener("DOMContentLoaded", init); function init(){ var dropbox = document.getElementById('dropbox'); dropbox.addEventListener('dragover', drag.over); dropbox

How do I handle multiple file drag/drop from Finder in Mac OS X 10.5?

南楼画角 提交于 2019-12-21 04:05:03
问题 I need to get the URLs of all files dragged/dropped into my application from Finder. I have a Cocoa app running on 10.6 which does this by using the new 10.6 NSPasteboard APIs which handle multiple items on the pasteboard. I'm trying to backport this app to 10.5. How do I handle this on 10.5? If I do something like below, I only get the first URL: NSArray *pasteTypes = [NSArray arrayWithObjects: NSURLPboardType, nil]; NSString *bestType = [pboard availableTypeFromArray:pasteTypes]; if

Drag and Drop a Folder from Windows Explorer to listBox in C#

若如初见. 提交于 2019-12-21 03:47:14
问题 I succeeded in developing C# code for drag files from windows explorer to listBox. // Drag and Drop Files to Listbox private void listBox1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop, false)) e.Effect = DragDropEffects.All; else e.Effect = DragDropEffects.None; } private void listBox1_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); foreach (string fileName in files) { listBox1

WPF Drag & Drop: How to literally drag an element?

社会主义新天地 提交于 2019-12-21 03:01:12
问题 Say I have a ListBox with some items and say I implement drag and drop functionality for that list. If I want to drag an item from that list box, how can I actually move the dragged item? I want to achieve the effect of having the list box item under my mouse cursor and to be able to move with it as I drag it on the window. By following this example, all I get is a cursor change based on the DragDropEffects enum choice. 回答1: This is typically done using an adorner. See here for an example.

How to debug a jQuery nested sortable draggable element?

不羁岁月 提交于 2019-12-21 02:19:25
问题 The first part allows you to first drag an element into a sortable div, which is working fine. I then want to have that div become sortable as well so I can drag new elements (parts) into those. That part works fine too, except sometimes if you reorder the elements (the darker ones) it wont let you put a part back into it until you either reorder them again, or try and put it in one of the other elements and go back to it. It's kind of hard to explain, but here's a screen-cast: http:/

Wicket Drag and drop functionality for adding an image

怎甘沉沦 提交于 2019-12-21 01:45:29
问题 I'm making a wicket app that can manage some options for a cashdesk app. One of the options is to change the image of a selected Product . The user(manager) can choose from the already present images in the database (SQL) when this option is selected, or add a new image if the desired image is not present. Don't mention the test names and awesome images (it's still in test-fase) I prefer to see the adding of an image achieved by Drag and Drop html5 demo [dnd-upload] (From the desktop into the

Drag and drop from Windows File Explorer onto a Windows Form is not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 21:34:08
问题 I'm having an issue dragging a file from Windows Explorer on to a Windows Forms application. It works fine when I drag text, but for some reason it is not recognizing the file. Here is my test code: namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_DragDrop(object sender, DragEventArgs e) { } private void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { e.Effect

Drag and drop from Windows File Explorer onto a Windows Form is not working

百般思念 提交于 2019-12-20 21:30:30
问题 I'm having an issue dragging a file from Windows Explorer on to a Windows Forms application. It works fine when I drag text, but for some reason it is not recognizing the file. Here is my test code: namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_DragDrop(object sender, DragEventArgs e) { } private void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { e.Effect

Android Drag and Drop getClipData returns always null

送分小仙女□ 提交于 2019-12-20 20:36:49
问题 I am designing a drag and drop operation but I don't know how to access my data. Has anyone experience with Clip Data objects? Here is my code: Starting the drag and drop: ClipData dragData= ClipData.newPlainText("my", "test") ); v.startDrag(dragData, new MyDragShadowBuilder(v), v, 0); Listening on the events: case DragEvent.ACTION_DROP:{ if (event.getClipDescription().getLabel().equals("my")) Log.d("myLog","Data:"+event.getClipData()+" "+event.getClipData().getItemCount()); 回答1: not in every