Questions tagged [treemodel]

109 questions
1
vote
1 answer

How do I read or write GTK TreeStores from/to files?

I'm new to this. How do I store a TreeStore to a file? I can store specific values from the underlaying TreeStore through the TreeModel interface, but is there any way of "grabbing" the whole underlaying TreeStore as a value, or do I have to…
john
  • 23
  • 2
1
vote
1 answer

Java: How to check entire JTree paths for String

I have been looking at this for awhile now but I cant really seem to find much about it online. I have a JTree and a list of strings. I want to search just the lowest levels of the JTree(so not every node in the tree is searched, just the lowest…
newSpringer
  • 1,018
  • 10
  • 28
  • 44
1
vote
1 answer

questions on "virtual trees" (custom TreeModel) in Swing

OK, I couldn't really find a decent example for a custom TreeModel in Swing that uses more than the basic features, so I wrote my own (code follows below) so I can ask questions about it, rather than about a more complicated application that's the…
Jason S
  • 184,598
  • 164
  • 608
  • 970
1
vote
1 answer

JAVA File Tree Model slow for pendrive

I'm developing an application which will work with external memories accessed through USB a lot. I've implemented TreeModel for browsing directories on disks. It works great for: local discs on Ubuntu connected external memories on Ubuntu local…
Bladositto
  • 293
  • 3
  • 14
1
vote
2 answers

Storing and using multiple values per JTree node

Okay, I'm very new to Java so please bear with me. I am using Netbeans 6.8 to write a small desktop application that includes a JTree component, and my requirement is that I be able to save and load the tree structure, but that the structure allows…
MaxVK
  • 327
  • 4
  • 14
1
vote
1 answer

defaultTreeModel nodes removed still shown in table

I am trying to remove nodes from a DefaultTreeModel. If I try to remove a single node, it doesn't get removed from the GUI. If I remove 2 nodes, only 1 of them is getting removed, etc. I am using removeNodeFromParent(node); to remove the…
Bogdan T.
  • 668
  • 6
  • 13
0
votes
1 answer

JTree and TreeModel with hierarchy of varying class?

I have a hierarchy of objects that I would like to show using a JTree and TreeModel. Each level of the hierarchy is a different class. All the examples of JTree and TreeModel I've seen have a common class throughout the entire hierarchy of the tree…
mark
  • 1,398
  • 13
  • 30
0
votes
1 answer

Java: Get the second highest ancestor of a descendant treenode

Using the DefaultTreeModel, defaultmutbletreenode's getRoot() returns it's highest ancestor, but how would you go one generation down to return it's second highest ancestor? root - ancestor 1 - some parent - some child - ancestor 2 - some…
KJW
  • 15,035
  • 47
  • 137
  • 243
0
votes
1 answer

Java: preorderEnumeration in TreeModel, how to get depthindex and sibling index?

for (Enumeration e = root.preorderEnumeration(); e.hasMoreElements() && theNode == null;) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement(); } For that example above, how can you find out how deep you are in…
KJW
  • 15,035
  • 47
  • 137
  • 243
0
votes
0 answers

Angular standalone component importing module error

Component imports must be standalone components, directives, pipes, or must be NgModules. Here treemodule is up to date but still getting the error . this is the error caused in component This is he error caused in main.ts Answers for the above…
0
votes
0 answers

JTree Issues Updating Nodes and with Key Handlers

I'm try to create a custom JTree using Checkboxes following the code from this post. But I'm running into three issues: When I try to change the name of one of the CheckBoxNodes (using the keyReleased handler), it wont update the text even though I…
cdubbs
  • 97
  • 12
0
votes
0 answers

How to stringify a tree model

I am working with treemodel to create a tree representation When I try to stringify it using json, or to string, I get an error of course. What is the best way to stringify this tree model? Here is example of my output config: {…
Yuvals
  • 3,094
  • 5
  • 32
  • 60
0
votes
1 answer

how to recursively delete all nodes in JTree?

in a JTree comprised of DefaultMutableTreeNodes, how would you traverse and delete starting from a given Node and all it's ancestors? it should delete starting at it's deepest level , backing upwards to the given Node. the given starting node should…
KJW
  • 15,035
  • 47
  • 137
  • 243
0
votes
3 answers

Java: serialize TreeModel, TableModel to JSON, and vice versa?

On the client side, a user specified input creates a unique TreeModel and TableModel. This needs to be serialized to JSON for storage on MongoDB (stores JSON document directly). The JSON needs to be parsed back into a TreeModel or TableModel which…
KJW
  • 15,035
  • 47
  • 137
  • 243
0
votes
2 answers

How do you apply a TreeModel to an element?

I am using the library TreeModel. It has great documentation except for the fact that it doesnt show how to actually show the tree in the html ? Does anyone have a clue ? I'm doing this cause I am practicing my data structures in building a Binary…
numerical25
  • 10,524
  • 36
  • 130
  • 209