Easiest way to make a list-like widget with drag and drop of items?

醉酒当歌 提交于 2019-12-07 07:15:00

问题


The simplest example I can think of are playlists, where you can drag a song to a different position in the list.

I've done quite a few things with Swing but I've never seen an example with something like this.


回答1:


Here's an example that might be close to what you want http://www.java2s.com/Code/Java/Swing-JFC/DragandDropJListandList.htm

There is a demo in the Oracle page linked in the comment to the first question: http://download.oracle.com/javase/tutorial/uiswing/dnd/basicdemo.html

Direct link: http://download.oracle.com/javase/tutorial/uiswing/examples/dnd/BasicDnDProject/src/dnd/BasicDnD.java



来源:https://stackoverflow.com/questions/6164581/easiest-way-to-make-a-list-like-widget-with-drag-and-drop-of-items

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