使用拖放项目制作类似列表的小部件的最简单方法是什么? [英] Easiest way to make a list-like widget with drag and drop of items?
问题描述
我能想到的最简单的例子是播放列表,您可以将歌曲拖动到列表中的其他位置。
The simplest example I can think of are playlists, where you can drag a song to a different position in the list.
我做了很多事情使用Swing但我从未见过这样的例子。
I've done quite a few things with Swing but I've never seen an example with something like this.
推荐答案
这是一个可能接近你的例子想要 http://www.java2s.com/Code/Java/Swing- JFC / DragandDropJListandList.htm
Here's an example that might be close to what you want http://www.java2s.com/Code/Java/Swing-JFC/DragandDropJListandList.htm
在第一个问题的注释中链接的Oracle页面中有一个演示: http://download.oracle.com/javase/tutorial/uiswing/dnd/basicdemo.html
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
这篇关于使用拖放项目制作类似列表的小部件的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!