My application has a canvas and a table, I need to add drag-and-drop capabilities to it. However, I read in a tutorial that Transfer converts the data I want to move into a platform-independent type. I have no need to drag anything outside of my program, and it’s important that the exact object be sent. How can this be done?
My application has a canvas and a table, I need to add drag-and-drop capabilities
Share
Okay, I figured it out. Apparently you can use some bogus transfer object, and keep the objects you want to move in your own variable. Define the variable when the drag starts, (from the
DragSource), and get the item from the variable inDropTarget. Just ignore the bogus transfer object.