开发者

Two DropTarget in the same class does not work (Java) ?

开发者 https://www.devze.com 2022-12-09 19:07 出处:网络
I have two Jlist in the same class each with DnD drop enable. The problem is whatever file I DnD from my desktop to the JLists eith开发者_C百科er number of or number 2 will populate ( and appear ) in

I have two Jlist in the same class each with DnD drop enable.

The problem is whatever file I DnD from my desktop to the JLists eith开发者_C百科er number of or number 2 will populate ( and appear ) in JList1. Jlist2 accepts the drag and drop but it is like the content is going to Jlist1 automatically.

Any idea on how to solve that ?


Maybe by cleaning your code ;-)

Take a look at the DropTargetListener you created to enable DnD operations. i think that either it

  • adds elements to list 1 datamodel wherever you drop them
  • is the same instance for list 1 and list 2, but configured to drop in list 1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号