1

I set a personal TransferHandler to my component:

myComponent.setTransferHandler(new PersonalTransferHandler());

class PersonalTransferHandler extends TransferHandler {
   public boolean canImport(JComponent comp, DataFlavor[] flavour) {
    ... 
   }
   protected boolean hasFlavor(DataFlavor[] flavors) {
    ... 
   }
   public boolean importData(JComponent comp, Transferable t) {
    ...
   }

Also I have a JTable with draggable elements (using another TransferHandler). I would like to copy elements from the JTable into myComponent. It works fine if the JTable is in the same JFrame that myComponent but if it is in a different JFrame I can drag the elements but I cannot drop into the compoment (the PersonalTransferHandler methods are not ever invoked).

4

0 回答 0