views:

28

answers:

1

I have a JList and want the user to be able to reorder the elements in the list using drag-n-drop (using my own ListModel and ListCellRenderer, if that makes any difference). Which Objects do I need to create, and how do I process the action?

+1  A: 

There is an example here:

http://www.java2s.com/Code/Java/Swing-JFC/DragandDropJListandList.htm

There are several examples on that site.

Starkey
This example doesn't do what I want, I want the JList to reorder its elements using DnD. The Example only enables dragging FROM the component.
Durandal
http://www.java2s.com/Code/Java/Swing-JFC/DragListDemo.htm should work. It used to be on Sun's tutorial site.
Geoffrey Zheng
Thank you Geoffrey, thats exactly what I was looking for.
Durandal