I use DropTarget and implement DropTargetListener to handle drop events, and it works great for accepting files (just see if there is a Transferable DataFlavor that returns true from isFlavorJavaFileListType() ).
Now I would like to ban certain types of garbage and give feedback accordingly:
- Deny multiple files (only one accepted file)
- deny a file whose file type is not in the accepted list
Can I do it? I think I remember working with XPCOM or COM, which was painful, in order to get enough information about the drop element, you had to accept it first, so there was a chicken / egg situation where you could only look at fragrance data, not the item itself, before you take a drop.
If I canβt abandon the discarded set of elements ahead of time, is there a corresponding user interface action (make a sound or something else) if the lost data is invalid?
source share