开发者

JTreeTable model updating

I'm following the example of JTreeTable filesystem2 taken from the sun site http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html#updating_the My problem is that I can't update my model (and then my JTreeTable)... In fact I create my model, I pass it to the JTreeTable and all work fine...but I need to modify the model... I've yet answer a similar question, but now I've changed my code, without find a solution.

The problem is when and how I have to call the method fireTreeNodesChanged()...in the example above is used the method getPath() to retrieve information about the r开发者_Python百科oot node...but this is a method of File class..not my case...

Does anyone have a link to a simple code which shows how create a TreeTabelModel (with objects as nodes) and how update it?


FileBrowser is a good example of modeling a hierarchical file system as a tree. While its TreeModel is implemented using DefaultTreeModel, an alternative FileTreeModel is shown here. As mentioned in How to Use Trees: Creating a Data Model "the TreeModel interface accepts any kind of object as a tree node."

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜