chibat
chibat

Reputation: 45

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.

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

Upvotes: 4

Views: 208

Answers (1)

karmakaze
karmakaze

Reputation: 36134

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

Upvotes: 2

Related Questions