I want to drag rows up/down (for example, drag 3rd row to 1st row)
in JList. I setDragEnabled(true) for JList, but it doesn't work!
How do I drag rows in JList?
Thanks!
Rhino - 14 Mar 2006 18:49 GMT
>I want to drag rows up/down (for example, drag 3rd row to 1st row)
> in JList. I setDragEnabled(true) for JList, but it doesn't work!
>
> How do I drag rows in JList?
I suspect it's a bit more complicated than just doing a
setDragEnabled(true)....
Have a look at
http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html.
--
Rhino
Fred Kleinschmidt - 14 Mar 2006 18:54 GMT
>I want to drag rows up/down (for example, drag 3rd row to 1st row)
> in JList. I setDragEnabled(true) for JList, but it doesn't work!
>
> How do I drag rows in JList?
>
> Thanks!
setDragEnabled(true) allows the user to drag the selection in the list and
drop it in another component - not within the list itself.
You will have to add a mouse listener to the JList and re-arrange the items
yourself.

Signature
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
self.
IchBin - 14 Mar 2006 19:00 GMT
> I want to drag rows up/down (for example, drag 3rd row to 1st row)
> in JList. I setDragEnabled(true) for JList, but it doesn't work!
>
> How do I drag rows in JList?
>
> Thanks!
Take a look at these examples..
http://www.java2s.com/ExampleCode/Swing-JFC/Drag-Drop.htm

Signature
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)