Windows Recycle Bin functionality.

I was wondering if there was a way to have something have the look and feel along with the functionality of the recycle bin:

  1. Have a graphic or icon in the browser to be drag and drop (more drop actually).
  2. Have the dragged component to the bin disappear behind the graphic.
  3. Have the ability to double click on the icon to show contents (to recover just in case).

I do understand the concept of drag and drop but I wasn’t sure how to approach recycle bin concept using it. Not sure if the bin
should be a panel and the first component would be the trash bin image and the rest be dragged hidden components.


You can use DragAndDropWrapper to wrap any component for dragging: I think the described functionality would be quite easy to implement with this. Just have a RecycleBin class where you store dragged items, and populate them e.g. in a window on double-click.

Thanks Thomas. It just hit me before i saw this. I just tested it to use the setIcon on the Panel class for my which is the root component in my DragAndDropArea class. This takes care of what i wanted to display. I’ll add the listener for double-click to expand and popup the window for contents.