This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Matt Kurz
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!