In my application I have 2 JTree controls in a JPanel. How can I transfer data between them, so that the items from the source tree are removed.
Asked
Active
Viewed 1,133 times
1 Answers
1
Write appropriate subclasses of javax.swing.TransferHandler
for both trees. Use TransferHandler.MOVE
as the source action. Override exportDone()
and see if the action includes the MOVE flag. If so, delete the object represented by the Transferable
.
Also see this question: Adding drag and drop support to Jtree