jtree Questions

4

Solved

I have a problem with expanding JTree nodes. I start when use selects a node everything but the path to the selected node and the selected node itself to be collapsed. I've tried using tree.colla...
Ponton asked 29/6, 2012 at 4:42

3

Solved

So this is a method of mine that is called everytime a new node is added.I need the model cleared everytime.The DefaultListModel has a .clear() method.The DefaultTreeModel does not.Help? public ...
Biller asked 2/10, 2012 at 20:19

2

Solved

I am having difficulty creating a JTree that allows the nodes to be reorganized by dragging and dropping them in the JTree. This seems like it should be relatively simple. I have looked at examples...
Sterner asked 3/1, 2011 at 20:32

2

My question is: if this two functions have something different? I mean I know that they return something different, but is it possible that number of elements in one would be different then in the ...
Lanark asked 12/3, 2013 at 18:55

5

Solved

I have a custom JTree and a custom JModel; I would for the JTree to "auto-expand" when I give it a new model. At the moment, it simply collapse all the nodes to the root. Here is an example: priv...
Miracle asked 4/3, 2013 at 20:57

3

Solved

I am using a JTree, which is using a DefaultTreeModel. This tree model has some nodes inside, and when I click on a node, I get the information of the node and I change the background color to show...
Bifurcate asked 27/3, 2019 at 10:57

3

Solved

I have loaded my JTree to view My directory structure as shown in my code and output image. Here, Tree nodes are by default sorted in alphabetical order, but my other requirement is that I want to ...
Etui asked 15/3, 2012 at 5:11

10

Problem Applying filtering on a JTree to avoid certain nodes/leaves to show up in the rendered version of the JTree. Ideally I am looking for a solution which allows to have a dynamic filter...
Preselector asked 10/2, 2012 at 20:19

3

Solved

since JTree & TreeModel don't provide tooltips straight out-of-the-box, what do you think, what would be the best way to have item-specific tooltips for JTree? Edit: (Answering my own question...
Peabody asked 7/11, 2008 at 13:53

8

Solved

First of all, let me say that I dont use the DefaultTreeModel. I implement my own TreeModel, so i cant use the DefaultXXX stuff. The problem is this: Through some addStuff() methods which my model ...
Catchfly asked 16/12, 2009 at 10:50

6

I'm trying to implement pop-up menus in Java JTree. I've sub-classed DefaultTreeCellRenderer (to change node appearance) and DefaultTreeCellEditor (to create Components to attach event listeners to...
Moniz asked 5/2, 2009 at 20:13

3

I am trying to remove the folder symbol from node of JTree which comes by default. How can I accomplish this?
Laise asked 10/3, 2011 at 13:25

2

Solved

I want to set a different icon for each node in my JTree component. I'm loading each node from a database using a while loop. I set each icon like a root, leaf, or parent. I set them as follows: Al...
Reimers asked 19/12, 2013 at 21:22

3

I am working with JTree. I would like to know what is best the way to know which nodes are expanded in a JTree so as to save its state (i.e. save all expanded paths). So that if I call model.reloa...
Jesu asked 7/10, 2010 at 5:33

5

I want to get text of an JTree in format: root sudir1 node1 node2 subdir2 node3 node4 Is it possible? I wrote some code public static String getLastSelectedText(JTree tree) { DefaultMu...
Behalf asked 7/2, 2011 at 5:39

6

I have a JTree with about 100000 nodes or more. Now I want to expand the whole tree. To do so I use the solution I found here. My problem is that expanding such a large tree takes like 60 seconds ...
Disband asked 15/12, 2009 at 12:35

4

Solved

How do I double-click a JTree node and get its name? If I call evt.getSource() it seems that the object returned is a JTree. I can't cast it to a DefaultMutableTreeNode.
Mcconaghy asked 11/10, 2012 at 20:23

3

Solved

I was looking for a a JTree implementation, that contains checkboxes and which: When you select one node, all its successors in the tree are automatically selected When you unselect one node, all...
Uniliteral asked 18/2, 2014 at 7:56

3

I am having a jtree with 100 nodes. now i want to search particular node from that tree and make that node expanded..? How can i solve this problem.?
Evangelina asked 21/11, 2011 at 10:55

5

Solved

I need an example how to add a keyboard handler that detect when Ctrl+C , Ctrl+X , Ctrl+C pressed on a JTree. I were do this before with menu shortcut keys but with no success.
Cuirass asked 11/5, 2011 at 21:20

3

Solved

Simple question. I have a TreePath to a node in my JTree. How can I convert this TreePath to the DefaultMutableTreeNode the TreePath points too?
Odilo asked 25/2, 2011 at 16:57

2

Solved

I have two JTree in two panels in a JFrame. I want to change the style(color and font) of nodes on drag and drop from one tree to the other.Please provide me a way to change the color of a JTree no...
Cellini asked 11/4, 2012 at 18:31

1

Solved

I know how to get item from selected item my left mouse button click. I can use TreeSelectionListener. tree.addTreeSelectionListener(new TreeSelectionListener(){ @Override public void valueChang...
Iota asked 14/12, 2014 at 10:20

3

I am using the Nimbus look and feel. According to this link, you should be able to achieve 3 different line styles with your JTree: While using the following code: theTree.putClientProperty("...
Submerged asked 18/2, 2011 at 15:10

1

Solved

I'd like to color elements in a JTree. However, simply adding a background color only to the label looks kind of strange. Particularly if more than one node is selected, the resulting shape looks r...
Yoon asked 3/11, 2014 at 23:6

© 2022 - 2024 — McMap. All rights reserved.