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 ...
Hendon asked 19/6, 2012 at 16:34

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...
Santiago asked 18/5, 2012 at 1:53

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...
Melodymeloid asked 3/5, 2012 at 16:3

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...
Bookrest asked 20/4, 2012 at 8:40

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...
Southdown asked 10/4, 2012 at 12:5

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...
Drusilladrusus asked 4/4, 2012 at 23:47

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

in connection with thread Jtable as a Jtree Node I put JTable to JTree, but JTree View isn't rendered correctly on start_up, how can I setPreferredSize for JTable, because PreferredScrollableViewpo...
Lubberly asked 12/1, 2012 at 23:3

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...
Manchu asked 12/1, 2012 at 16:59

2

Solved

I am attempting to modify the standard Swing JTree to intermingle nodes with and without checkboxes. This is an example: When I attempt to check/uncheck one of the checkboxes (the 'User 01' node...
Frigg asked 13/1, 2010 at 16:58

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 ...
Fundy asked 2/12, 2011 at 1:58

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...
Hecatomb asked 14/11, 2011 at 9:45

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...
Pneumonoultramicroscopicsilicovolcanoconiosis asked 26/7, 2011 at 9:28

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...
Presidium asked 27/5, 2011 at 4:52

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 */ ...
Chymotrypsin asked 25/2, 2011 at 18:28

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...
Handrail asked 9/1, 2011 at 18:7

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
Soniasonic asked 29/10, 2010 at 6:49

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...
Rhiana asked 29/9, 2010 at 12:59

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!
Allegorize asked 18/8, 2010 at 8:32

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...
Kenyettakenyon asked 19/5, 2010 at 0:38

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...
Ejective asked 12/2, 2010 at 22:13

© 2022 - 2024 — McMap. All rights reserved.