# Reorder listbox items by drag and drop?

**URL:** <https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970>\
**Category:** General JUCE discussion\
**Created:** [June 11, 2014, 1:19am UTC](https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970 "2014-06-11T01:19:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernard\_Shaw](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bernard\_Shaw](https://forum.juce.com/u/Bernard_Shaw)\
**Post date:** [June 11, 2014, 1:19am UTC](https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970/1 "2014-06-11T01:19:32Z")

</div>

Hello, been struggling with this for days now getting my head around it: what do i need to reorder listbox items, i have successfully created a few times listboxes based on the juce demo one, i even got it to work as a drag and drop souce, but how do i reorder them? and provide visual feedback? Thanks.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 11, 2014, 9:07am UTC](https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970/2 "2014-06-11T09:07:27Z")

</div>

Well, you'd need to intercept the rows being dropped, and re-order the actual data that your listbox is showing.

---

<div class="post-metadata">

**Author:** ![Bernard\_Shaw](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bernard\_Shaw](https://forum.juce.com/u/Bernard_Shaw)\
**Post date:** [June 14, 2014, 1:30am UTC](https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970/3 "2014-06-14T01:30:00Z")

</div>

And if Im drawing a custom component? it fills the entire listbox row

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [June 14, 2014, 8:51am UTC](https://forum.juce.com/t/reorder-listbox-items-by-drag-and-drop/12970/4 "2014-06-14T08:51:08Z")

</div>

Well, if you're drawing it yourself then you'd need to make your custom component react to drag-and-drop and&nbsp;draw some kind of appropriate drag-over graphics.
