DnD « Drag Drop « Java Swing Q&A





1. Detecting drops from the same process    stackoverflow.com

Is it possible for a class implementing DropTargetListener, to detect whether the stuff being dragged comes from the same process of from elsewere?

2. What is a good way to make DnD snap to the possible drop locations on the JVM?    stackoverflow.com

For example, let's say that you are making a card game. Then you might want to be able to drag the cards NEAR the stacks, and then it drops the cards ...

3. Custom DragAndDrop in Java    stackoverflow.com

I Have a JList with custom objects. I would like to select the object from the list and drag and drop to a JPanel. But I'm confused about all terms in ...

4. Java: How to drag and drop on a TrayIcon?    stackoverflow.com

How can I catch a drop event of a text / file / any other DataFlavor onto a java.awt.TrayIcon (placed in a java.awt.SystemTray)?

5. dnd using control key..urgent    coderanch.com

6. DnD in JDK 1.1.* ?    coderanch.com

7. Overriding default DND implementation    coderanch.com

I am working on DND in a JTable. I can't figure out where or how the dragAction gets set. The default behavior for DND seems to be to allow dragging at all times. But I need the basic table dragging behavior to extend the selection, and allow DND only with a modifier key. Any ideas how to do this?? My predecessor ...

8. Newbie at DND    coderanch.com

9. Attn: DnD Gurus!    coderanch.com





10. Dnd Trouble    coderanch.com

11. Dnd not serializable    coderanch.com

12. DnD Problem in drop()    coderanch.com

13. Drag and drop is only in java.awt.dnd?    coderanch.com

14. dnd    coderanch.com

You don't need to use the Drag and Drop API unless you are going to be transferring the rectangle between components. To get the rectangle to move within the same component that is drawing it, you would just add a MouseListener and a MouseMotionListener to that component. In the mousePressed() method, you would try to detect if the rectangle was clicked, ...

15. DnD problems with different JRE:s    coderanch.com

16. reinstating DnD on saved object    coderanch.com

Hi there, I'm trying to figure out how to reinstate functionality of serialized saved objects when I open a saved file. I make use of Drag 'n Drop in my application. Several instances of an object that is getting saved is a class I named TargetPanel which extends JPanel implements Serializable and in its constructor it calls a method called installDnD(). ...





17. DnD: from non-Java app to Java app    coderanch.com

18. Drag & Drop (DnD) & Optimizing    coderanch.com

Hi, I'm new to the Ranch. I would normally ask my friend who is pretty good with Java but he hasn't been online lately and I want the program done by next weekend. (heres his website for the curious ones www.yellowbirdcomputing.com ) Anyway, here are my questions: 1. I have a little 1st program which I want to add DnD to. ...

19. DND out of an application?    coderanch.com

For the most part I've figured out DND with trees and other thing within a GUI but now I'd like to DND out of the application and say. Say I have a JTree representing directories on the file system. I'd like to be able to drag from my GUI onto the desktop and have windows copy the file to the desktop. ...

20. Handeling DnD in Java    coderanch.com

Hello I have a question about DnD handling in java. I know it's possible to handle Drag and Drop within one java application, however is it possible to handle items that are being dragged from outside a java application? For instance is it possible to handle a MS-Windows file being dropped in a java application? To put it into context. I ...

22. DnD duplicate element    coderanch.com

23. DnD problem    java-forums.org

Ho guys i want just your idea about the following problem: i have a jlabel than implements a droptarget listener...it makes some operation when i drop an image inside(this image is dragged from another component)... I would to limitate the drop area inside the component without(or with less) modify the droptarget method. I create a polygon inside jlabel and i would ...

24. java DnD    java-forums.org

Please read the second link in my signature links below on how to ask smart questions because you're asking us to help you solve a problem but for some reason have elected to not tell us anything that would allow us to do so. You've given us no usable information, hence Darryl's sarcastic answer that he found in his crystal ball. ...

25. DragImage while dnd    java-forums.org

public class DragListener implements DragGestureListener { public DragListener(Component component) { this.component = component; } public void dragGestureRecognized(DragGestureEvent dge) { BufferedImage image = null; try { image = ImageIO.read(new File("images/bin.png")); } catch (IOException e) { e.printStackTrace(); } dge.startDrag(new Cursor(Cursor.CROSSHAIR_CURSOR), image, new Point(0, 0), new TransferComponent(component), new DragSourceAdapter() { @Override public void dragEnter(DragSourceDragEvent e) { // here goes some animation } }); } ...

26. DnD and CCP from non jave apps    java-forums.org

I'm feeling a bit stupid about this topic because I just read the entire tutorial Lesson: Drag and Drop and Data Transfer (The Java Tutorials > Creating a GUI With JFC/Swing) and still don't understand how to actually detect the drop or CCP event. I want to be able to simply allow the user to drag or copy, cut, and paste ...