Swing drag and drop [closed]

安稳与你 提交于 2019-12-21 17:38:47

问题


I would like to implement a game board in swing (needs to be a table, though about either jtable or gridlayout etc ...) where I will be able to drag and drop a picture on to this game board and all the cells that the picture fell on will get a notification that they were chosen.

Can anyone help with that? how do I get a couple of cells in a table know that an object was dropped on them?


回答1:


Have a look at this tutorial.




回答2:


I think you have to spent some time with Google. I found the following with a little time with Google.

  • Introduction to DnD
  • How to drag and drop with Java 2, Part 1
  • How to drag and drop with Java 2, Part 2
  • Drag and Drop Effects

Hope this helps :)




回答3:


Read this and if you have an more specific questions come back and ask them.



来源:https://stackoverflow.com/questions/8562743/swing-drag-and-drop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!