Removing Drop Function after adding TransferHandler in Button
With the current implementation, I can drag the text inside the buttons to other components. The original plan was only to be able to drag it to JPanels, but because of TransferHandlers, the buttons themselves can receive dropped objects, and worse, if it receives a string, it changes the displayed text on that button to the string that was dropped.
TransferHandler transfer = new TransferHandler("text");
JButton button = (JButton)e.getSource();
TransferHandler handle = button.getTransferHandler();
handle.exportAsDrag(button, e, TransferHandler.COPY);
I need help as to how to disable the ability of the button to catch a dropped object or at least disable the automatic changing of the text displayed. Thank you very much!
Re: Removing Drop Function after adding TransferHandler in Button
Can you post a SSCCE (a small complete program that compiles, executes and shows the problem)?