26 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
287
views
I already have a checkbox in a Java Swing TreeNode. But how do I make it checkable?
Note: I am NOT asking how to put a checkbox in a JTree - previously, a confused moderator thought this is what I was asking. I already have the checkbox in the tree. I am asking what class or method ...
1
vote
1
answer
212
views
How would one convert a JSONObject into a DefaultMutableTreeNode in java?
I want to create a way to convert a JSONObject like this:
"master root" : {
"folder 1" : {
"folder 2" : {
"example data" : "some more example values",
"example ...
1
vote
1
answer
147
views
JTree changes lineStyle when changing node's name
TLDR:
Updating the nodes of a JTree changes the lineStyle (pictures below) and I don't know why this happens and how to prevent it from happening as my code doesn't update any porperties of the ...
0
votes
0
answers
70
views
"AWT-EventQueue-0" java.lang.StackOverflowError - While trying to create JTree folder structure
I'm trying to build a JTree folder structure from a output. Here is the approach.
I call a system
get list of folders
loop through list of folders and create a list
create a folder structure from the ...
0
votes
2
answers
220
views
Add same DefaultMutableTreeNode to 2 different DefaultMutableTreeNode
I have a DefaultMutableTreeNode("birds") which has n number of children. Now I want to add this node to 2 different parents DefaultMutableTreeNode("animals") & DefaultMutableTreeNodes("animals2")....
1
vote
1
answer
325
views
xml to jtree parsing in java
I have a following xml, with multiple levels( level 1, level 2, level 3). All the level 1 will go into the tab like showed in the picture.
<?xml version="1.0" encoding="UTF-8"?>
<treeNode ...
-1
votes
1
answer
74
views
JTree displaying drive does not show up at all
My task is to show a tree of all directories/files of a PC drive,
I have a class DirectoryNode that extends DefaultMutableTreeNode with File field directoryPath. I build nodes recursively:
public ...
0
votes
0
answers
44
views
Java Swing > Calling specific powershell script by selecting DefaultMutableTreeNode from Jtree model
I'm having my first time with java Swing and I wondering if can I add values for each DefaultMutableTreeNode and refer to them by selecting specific node?
e.g. Calling specific powershell script by ...
0
votes
1
answer
864
views
Dynamically add nodes in an JTree
i have got a problem to add nodes dynamically to my JTree.
I receive my JTree Informations via a RestAPI in json Format.
The informations i need are the folderID and the folderName.
The folderID ...
0
votes
1
answer
253
views
TreeView nodes names bugging
I'm having a lot of trouble dealing with TreeView, more specificcaly with the text shown per node.
Starting with an initializer for the Tree, where I expected a single node with the text, it might ...
1
vote
1
answer
89
views
DefaultMutableTreeNode value set to be default when use it to Spark mapToPair
I have a question that type DefaultMutableTreeNode variable's value turns to default once use it in Spark mapToPair() function. Here is my code:
public class CA implements Serializable{
private ...
2
votes
2
answers
1k
views
Filter jtree - keeping all nodes and children of nodes that match criteria
I have a JTree of DefaultMutableTreeNodes and I would like to filter them.
When I do a filter, I want to keep any node that matches my criteria or has children that match my criteria.
Here i ...
1
vote
1
answer
125
views
JTree node editing path comparison always true
I've been working on a file server program for a while, and thus far I've been able to avoid posting something here for help. But I cannot find anything on my problem and I am very confused.
I've ...
0
votes
0
answers
158
views
Select the TreeNode before (java swing, tree)
I am looking for a way to select the TreeNode before the actually selected node (if no Node is selected, the first Node AFTER the root should be selected) on Button click. I am basically having a ...
1
vote
1
answer
130
views
How to create a JTree ExpansionListener
I am having trouble creating a TreeExpansionListener. I thought it could be as easy as a TreeSelectionListener. Unfortunately I cannot find the correct interface.
Here is my listener:
private ...