摆动拖放 [英] Swing drag and drop

查看:98
本文介绍了摆动拖放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在秋千中实现一个游戏板(需要一张桌子,尽管关于 jtable gridlayout etc ...)在那里我可以将图片拖放到这个游戏板上,图片所有的单元格都会收到他们被选中的通知。

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?

推荐答案

看看< a href =http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html =noreferrer>本教程。

这篇关于摆动拖放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆