File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Restrict drops to JPanel where it's drags are from. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Restrict drops to JPanel where it Watch "Restrict drops to JPanel where it New topic
Author

Restrict drops to JPanel where it's drags are from.

Matt Kurz
Ranch Hand

Joined: Jan 02, 2010
Posts: 40
The attached screenshot consists of 2 JPanels. Each has 2 JLists. I want to allow drag and drop only inside one JPanel. For instance drops from TopPanel to ButtomPanel or complete outside to desktop or something else should NOT be allowed. My solution already works panel specific, but drops outside are still possible. How can I deactivate that? Here is the standalone example code:




[Thumbnail for 2panels.jpeg]

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Restrict drops to JPanel where it's drags are from.
 
Similar Threads
Drag and Drop between 2 JLists - ReportingListTransferHandler
How to change mouse cursor during drag and drop
drag and drop DND click, then move??
Pasting image in JTable cells
Drag cursor not changing, but drop succeeding.