DragAndDropContainer question


I’m trying to implement dragging between two TableListBoxes, and to do so, I wanted to use the sourceComponent parameter of itemDropped() to distinguish between a drag that started in TableListBox1 vs. TableListBox2.

So, I was surprised to find that the sourceComponent is actually my window, not the originating list. The notes in the header of DragAndDropContainer say “It’s probably best for the top-level component to implement it.”

Is there a reason to avoid finer granularity? Will creating a derived TableListBox class that is also a DragAndDropContainer cause me other problems?


I’ll answer my own question…making the TableListBox a DragAndDropContainer works swimmingly. Even better after I remembered that I really wanted the model, not the TableListBox component.