Drag and Drop question
Deriving from TransferHandler to implement drag and drop, I am looking for a way of displaying the "no entry" sign (mouse pointer) over a component if the actual data, not its DataFlavor, is invalid.
I am dragging a Vector of ImageIcons, but I want to place a cap on the size of the Vector. All I can check in canImport (which is triggered when the mouse hovers over the component I want to drop onto) is the DataFlavor ( "mumble mumble java.util.Vector"). I can easily reject an overly long Vector in importData, because the whole Transferable is supplied, but by then it is too late to correct the mouse pointer.
All I think of is to implement a whole bunch of different DataFlavors for the possible lengths of the vector i.e. have VectorOfOne VectorOfTwo, just so canImport can know to reject some of them...
I am dragging a Vector of ImageIcons, but I want to place a cap on the size of the Vector. All I can check in canImport (which is triggered when the mouse hovers over the component I want to drop onto) is the DataFlavor ( "mumble mumble java.util.Vector"). I can easily reject an overly long Vector in importData, because the whole Transferable is supplied, but by then it is too late to correct the mouse pointer.
All I think of is to implement a whole bunch of different DataFlavors for the possible lengths of the vector i.e. have VectorOfOne VectorOfTwo, just so canImport can know to reject some of them...
