开发者

Java: Cut item from JTree with lazy-deleting

开发者 https://www.devze.com 2022-12-20 12:21 出处:网络
I\'ve implemented Drag\'n\'Drop and CCP on my JTree (I\'ve created my Transferable and TransferHandler classes).

I've implemented Drag'n'Drop and CCP on my JTree (I've created my Transferable and TransferHandler classes).

By default Cut a开发者_开发知识库ction (CTRL-X or SHIFT+DELETE keys) delete item from JTree (JTreeModel), but I want just to mark it with gray color and delete it only after Paste action.

How could I make Cut action to avoid deleting items?

I don't know all the magic of swing DnD, but it looks like Cut action is implemented in TransferHandler.getCutAction()


Kill me please, everything works fine by default. The reason was in my code.

0

精彩评论

暂无评论...
验证码 换一张
取 消