开发者

how to incorporate visual tree xml editor swing component?

So far I have used dom4j's DefaultTreeModel to create a Jtree out of the xml file it reads.

The problem is that the Jtree doesn't refresh everytime the xml is changed, or a node is added or removed.

So far, it appears there is much plumbing code involved because there doesn't see开发者_运维技巧m to be implementation of OnXmlChanged().

What other alternatives do I have of incorporating a visual tree xml swing component that also supports event firing upon change in the underlying xml file.


You can always fire these events your self when you know that something has changed, From DefaultTreeModel, use:

protected  void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) 

protected  void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) 

protected  void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) 

protected  void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜