Java: DefaultMutableTreeNode Event When Renamed

十年热恋 提交于 2019-12-12 01:48:30

问题


I created a class that extends DefaultMutableTreeNode. It has a variable, "resource" of the type Resource so that it can be linked to an object without that object affecting its name. The Resource class has a variable, "name" that I would like to be changed when its corresponding DefaultMutableTreeNode is renamed, but I can't find any such events.


回答1:


In DefaultTreeCellEditor there is this method: http://docs.oracle.com/javase/7/docs/api/javax/swing/tree/DefaultTreeCellEditor.html#addCellEditorListener(javax.swing.event.CellEditorListener)



来源:https://stackoverflow.com/questions/11105401/java-defaultmutabletreenode-event-when-renamed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!