jtree Questions
1
Solved
I created a class that extends DefaultMutableTreeNode. It has a variable, "resource" of the type Resource so that it can be linked to an object without that object affecting its name. The Resource ...
1
Solved
I am trying to implement a JTree to represent a database!
The Root is the database, which can have several relations. Each relation can have attributes and functional dependencies.
Each node (data...
Easternmost asked 9/5, 2012 at 9:17
1
Solved
Is it possible to add some blank space between node rows in a JTree? I am using custom images for the node icons and I guess the images are larger than the standard node icons, so the node icons si...
1
Solved
I want to know how to implement this feature:
I have editable JTree where I can edit name of the nodes. If I have some node which is branch node (it has some leaf nodes in it) and this branch node...
1
Solved
I have a JTree and an awt.Canvas. When i select multiple objects from within the Canvas into the objList, I want all the selected items to be shown inside the JTree as selected. That means for exam...
3
Solved
I have a JTree with a few nodes and subnodes. When I click on a node I want to know on which depth is it (0, 1, 3). How can I know that?
selected_node.getDepth();
doesn't return the depth of c...
1
Solved
I've been using seesaw.tree/simple-tree-model to create my TreeModels, the docs say that this is read only. Originally I didn't need to edit the tree structure however now I do!
There is a pull re...
2
Solved
I am using this below piece of code:
class CountryTreeCellRenderer implements TreeCellRenderer {
private JLabel label;
CountryTreeCellRenderer() {
label = new JLabel();
}
public Component ...
Saddlebacked asked 29/1, 2012 at 6:43
2
Solved
1
Solved
I know you can create a table and add a JTree as a column. But what I want to do is the complete opposite.
Check the image and tell me if this is possible. Thanks!
UPDATE:
By using MKorbel's c...
2
Solved
2
Solved
Basically I edit an attribute private string status="OK" in the UserObject() of a DefaultTreeNode().
I have a CustomRenderer which implements DefaultCellRenderer, which sets the Icon by rendering ...
3
Solved
I need to use custom cell renderer for my JTree to add some JLabel on each cell. And then allow the user to click on these label without needing to select the cell first.
So, i've created a Render...
1
Solved
I have a very basic JTree. As I am on a rush, I'd prefer not to use TreeModel if it is not needed. I wrote a SSCCE to expose the problem:
Sometimes I add a node. Other times I remove them. When I ...
Algophobia asked 28/10, 2011 at 11:52
2
Solved
I have a JTree with a custom associated MouseListener (for showing popup etc.). I need to fire a MouseEvent that will be caught by the MouseListener. How should I do that programmatically?
Waterscape asked 27/7, 2011 at 10:39
1
Solved
I need to make only leaves of a JTree draggable but the following code snippets makes every node in the tree draggable:
tree.setDragEnabled(true);
How can I restrict the draggable element to spe...
2
Solved
I want to change just the first node of a JTree icon. There is a file manager that uses JTree to show files. Here is a schematic example. How can I change the icon?
Back
|->Please wait(this is le...
2
Solved
I am trying to change the name of a node in my JTree. I use the following code to do so:
/**
* Change the name of the currently selected node
* @param newName Name to change the node too
*/
...
2
I'm looking for changing the different icons of my JTree (Swing)
The java documentation explains how to change icons if a node is a leaf or not, but that's really not what I'm searching.
For me i...
1
Solved
I want to use a tree in my Scala swing application, but the component isn't available in the API.
Does a wrapper of JTree exists ?
If not, do you have any advice for making it ?
Thanks
3
Solved
I used a JTree in my GUI and added it to a JFrame. When I want to update it and change it's nodes in another part of my program (while program is running, as an action performed) I try to add new n...
4
Solved
i would like to add an additional button with a small icon to the right of an item in a JTree.
can this be done? if so, how?
thanks!
4
Solved
I am new in swing, but managed to create a descend gui.
My problem though is that I was not able to apply the patterns suggested in references/tutorials, mainly the MVC pattern.
Is it me, or in JT...
Bigamy asked 13/9, 2010 at 18:1
1
Solved
I want to find a method like isNodeExpanded() to check if a given JTree node is expanded or not, but I can not find it.
I know I can do this by tracking the node expansion with the TreeExpansionLi...
1
Solved
Currently, I'm using a custom TreeCellRenderer to handle label and icon changes for my JTree. The problem comes when I need to change the text on a few nodes. The TreeCellRenderer works great in th...
© 2022 - 2024 — McMap. All rights reserved.