#Drag-to-rearrange list view of JPanels?

1 messages · Page 1 of 1 (latest)

pulsar stream
#

I'm looking for a Swing component that displays a list of JPanels in a vertical list.
The JPanels are wrapped such that one side of the container has a drag handle.
The handle lets the user drags to rearrange the elements.
The JPanels must be responsive, unlike a JList (paints, reorders, doesn't respond).
A nice to have might be a "trash slot" where items can be dragged to remove them from the list.

Do you know of such a component in the wild? Please share.

trim dawnBOT
#

<@&987246487241105418> please have a look, thanks.

hallow sonnet
#

For DragHandle, Personally I used Transfer Handler back then.

#

however it isn't optimized for reordering UI panels with custom handles

#
GitHub

Config files for my GitHub profile. Contribute to tips4java/tips4java development by creating an account on GitHub.

GitHub

Config files for my GitHub profile. Contribute to tips4java/tips4java development by creating an account on GitHub.

pulsar stream
#

Thanks, but that's not what I'm looking for.

hallow sonnet
frank lotus
#

the "paints, reorders, doesnt respond" sounds like poor usage of the jlist api

#

because the first is a non-issue: it needs ro be repainted

#

reordering only occurs on request, you can feed the list the exact order you want

#

"doesnt respond" is basically the same as "my code doesnt work", which doesnt give us enough info to help proper

#

but jlist with dnd could achieve what you're asking about

#

its how most handle it in a swing environment

#

don't like it? stop using swing

hallow sonnet
#

yep

frank lotus
#

if you're forced to use swing, then jlist with dnd is the route

#

if it becomes a performance bottleneck, youre probably doing it wrong