在lwuit中动态创建树视图节点
TreeModel model = new TreeModel() {
Node[] sillyTree = {
new Node("X", new Node[] {
new Node("Child 1", new Node[] {
}),
new Node("Child 2", new Node[] {
}),
new Node("Child 3", new Node[] {
}),
}),
new Node("Y", new Node[] {
new Node("A", new Node[] {
})
}),
new Node("Z", new Node[] {
new Node("A", new Node[] {
}),
}),
};
我想动态地创建一个节点,上面的静态示例代码 请帮忙
TreeModel model = new TreeModel() {
Node[] sillyTree = {
new Node("X", new Node[] {
new Node("Child 1", new Node[] {
}),
new Node("Child 2", new Node[] {
}),
new Node("Child 3", new Node[] {
}),
}),
new Node("Y", new Node[] {
new Node("A", new Node[] {
})
}),
new Node("Z", new Node[] {
new Node("A", new Node[] {
}),
}),
};
I want to create a node as dynacially,above sample code for static
plz help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅TreeDemo 类。这里动态地从文件根检索值并将该值添加到向量中。请参阅 TreeDemo 类中的 FileTreeModel 内部类。您可以遵循相同的操作并添加类似的动态值。
See the TreeDemo class in UIDemo application. Here dynamically retrieve the values from file root and add that values into vector. See the FileTreeModel inner class from TreeDemo class. You can follow the same thing and add the dynamic values like that.
这可能会有所帮助 -
并且 -
This might help -
And -