Dragging a JLabel with a TransferHandler (Drag and Drop)
I am using a TransferHandler to pass data from a JPanel to a JTextArea as a JLabel (Click somewhere in the left panel to create the JLabel to drag) The transfer of the data works fine, but I'd like to also "show" the JLabel as its being dragged along with the mouse pointer. If you comment out dropLabel.setTransferHandler(new TransferHandler("text")); dropLabel.getTransferHandler().exportAsDrag(dropLabel, e, TransferHandler.COPY); you will see how I want it to look. (but of course then the data won't be transferred). How can I get both the transfer to work and the JLabel to follow the mouse