Skip to main content

All Questions

Tagged with
0 votes
0 answers
26 views

Draggable nodes in JTree

This is the TransferHandler code I found here. JTree is completely draggable, but the problem is that when I move one of the nodes, in the place where I put that node, two nodes are added instead of ...
BaRiBoD's user avatar
0 votes
0 answers
19 views

Java - JTree, DefaultModelTree won't update

Is it possible to add nodes just before expanding a tree, no matter how I approach this it just doesn't work at all. I've used all of the DefaultTreeModel's functions and it just doesn't seem to work, ...
Cameron Sims's user avatar
1 vote
0 answers
54 views

How can I change the text color to certain elements of JTree but not to the whole tree?

I know that I can change the text color using: import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import java.awt.*; public class ...
Juan Alvarez's user avatar
1 vote
1 answer
94 views

JTree Default icons not removed with Root Icon

I am aware that there are relevant materials exists on google about JTree icons change, but still I am unable to sort out my simple requirements. I need to change the icon of Root element of JTree ...
Alpha's user avatar
  • 187
0 votes
1 answer
60 views

Issue with Swing JTree Checkbox Behavior

Facing this issue with my code while working with checkboxes in a JTree. The root node is treated as a "Named Vector" in first iteration instead of a "CheckBoxNode"As a result, it ...
JamesB's user avatar
  • 493
0 votes
0 answers
32 views

JTree. Wrong gui update order

I have JTree. Child nodes are loaded dynamically when the parent node is expanded (treeExpanded event). Their loading time is a few seconds. I want to display the message "Wait" in the ...
mihhha's user avatar
  • 13
-1 votes
2 answers
110 views

Java Swing's JTree uses node's hashcode - why?

It seems JTree has a -for me- unexpected behavior: it relies on the hashcode of the nodes instead of relying on its model. This deviates from the way e.g. JTable and JList work: these two allow you to ...
tbeernot's user avatar
  • 2,574
2 votes
0 answers
52 views

update JTree nodes with a full TreeNode hierarchy instead of update

I have a JTree that I want to update its node based on a list that I have receiving from remote (some of its data is already in Tree ,so they are some repeatations) Here is my data model that comes ...
AmirHossein Abdolmotallebi's user avatar
-1 votes
1 answer
73 views

Trying to use standard JTree implementation, but the output is really messed up

I'm trying to use JTree. Here is my example test class: package inspector; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.util.ArrayList; import java.util....
Alex654's user avatar
  • 31
0 votes
0 answers
57 views

How do I refresh/update the Custom fileTree Swing component by itself during file changes?

I found this Custom fileTree Component from github to implement it into my project, I'm using this JTree component to access and display file information like file name, file path, file type in a ...
Astron's user avatar
  • 1
-1 votes
1 answer
53 views

How to change background color of a jtree node

I am having a netbeans project with jtree and DefaultMutableTreeNode. I have to search a node in the tree by its name and want to highlight it, for highlighting I think I will change the background ...
aashish's user avatar
  • 21
0 votes
0 answers
27 views

how to add Folder directory or files in a folder to JTree of my code, before answering check the code that I written [duplicate]

import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;...
Lohith's user avatar
  • 1
-2 votes
1 answer
277 views

class cannot be cast to class javax.swing.tree.DefaultTreeCellRenderer error

public class jtre extends javax.swing.JFrame { static{ try{ UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName()); }catch (ClassNotFoundException ex){ ...
Moon Light's user avatar
1 vote
1 answer
143 views

Java : JTree and BasicTreeUI reference doesn't show scrollbars

Working with the JTreeWithScrollbar example, but scaled it back significantly to focus on the issue. The original code would have the vertical scrollbars appear as needed. Here, there is plenty of ...
Unhandled Exception's user avatar
1 vote
1 answer
41 views

Java - JTree not following Path hierarchy

I need to create a tree node that uses a HashMap to build a tree of files, the key of the HashMap is the Path and it's Value is the File Name. I've implemented a code that breaks down the key value to ...
user avatar

15 30 50 per page
1
2 3 4 5
68