Questions tagged [jtree]

Java Swing component that displays a set of hierarchical data as an outline.

JTree is a class in the javax.swing package. It is a Swing component that displays a set of hierarchical data as a tree outline. Like most Swing components, it has a model, is highly configurable through the use of renderers, and fires events that can be handled.

Resources

1222 questions
-1
votes
1 answer

JTree - how can i stop children from showing relative path?

Before we start, I'd like to note that I'm rather new to JTree and its relatives. The children in my nodes show the relative path back to its parent, but I'd like for it not to. Here is a picture of what it looks…
Polycoding
  • 25
  • 8
-1
votes
1 answer

show all system's files and folders in jtree

I am new to java development I am trying to display all the drives of system including all files and folders. This code is working fine but only display the single directory or drive. how i can make it display all the drives on my system's including…
Azeem Aslam
  • 554
  • 5
  • 19
-1
votes
2 answers

Swing : BoxLayout fill the entire JPanel

I am adding list of JTree items inside JPanel. I want the parent JPanel to have BoxLayout so that the tree can be added vertically one after another. The parent JPanel is initialized using : holder.setLayout(new BoxLayout(holder,…
ayush
  • 14,350
  • 11
  • 53
  • 100
-1
votes
2 answers

What 's wrong with my JTree code?

I downloaded a JTree program from http://kodejava.org/examples/566.html site. It is compiling but when running the program, it is giving this exception: Exception in thread "main" java.lang.NoClassDefFoundError: JTreeDifferentNodeIcon (wrong name:…
user27510
  • 37
  • 3
-1
votes
4 answers

Create JTree using data from text file

How can I create a JTree using data from a .txt file? The text file is formatted as follows: Root Node Category A Sub-Category A1 Item A1.0 Item A1.1 Item A1.2 …
engineervix
  • 345
  • 2
  • 6
  • 17
-1
votes
2 answers

JTree without leaf

Is it possible to make a JTree without leaf? If it is possible then please tell me way. I want to convert these highlighted leafs as the folder or parent. If you want any thing else apart from it then please let me know.
Java_Alert
  • 1,159
  • 6
  • 24
  • 50
-1
votes
1 answer

JTree and JEditorPane in Java

I have JTree and JEditorPane control in a Swing form . JTree has 3 nodes and further subnodes . I have to set text in front of the nodes and subnodes eg following delhi :100 old delhi:50 new delhi:50 mumbai:200 ..... these 50 100 and 200 value…
adesh kumar
  • 129
  • 3
  • 10
-1
votes
3 answers

How to get List of all files/directories from a JTree

I have a JTree which contains file/directory, i want to get a list which contains current list of this JTree. How can i do it? menuItemZip.addActionListener(new AbstractAction() { public void actionPerformed(ActionEvent e) { …
itro
  • 7,006
  • 27
  • 78
  • 121
-2
votes
1 answer

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){ } catch…
-2
votes
1 answer

JTree Editor- Where is getCellEditorValue() called?

When a device editor is set for a JTree, when/where is the method getCellEditorValue called after cell editing has stopped? I need to modify the behavior where this method is called in order to allow the Editor to update multiple nodes instead of…
CoupFlu
  • 311
  • 4
  • 20
-2
votes
1 answer

Find If Objects in Collection have same field values

I'm attempting to create an editor to edit multiple devices that are selected in a JTree. If items in the Collection all have the same value for a certain field, I will display that value in the editor form. If they have different Values, i will…
CoupFlu
  • 311
  • 4
  • 20
-2
votes
1 answer

How do I make a component like this in Eclipse Java WindowBuilder?

I would like to make such a tree-like component with many roots. What component should I use? JTree doesnt allow multiple parents.
-2
votes
1 answer

JTree code doesn't work

I don't know much about java and I have spend many days trying to find out what I am doing wrong. I have a JFrame form named FileManagerFrame and a Bean Form with a JTree inside. In JTree I have this code: /* * To change this license header, choose…
Kiki
  • 75
  • 1
  • 1
  • 7
-2
votes
1 answer

JTree two nodes with same name can't be differentiated with getSelectedPath

I have two working JTrees and i can edit/delete/add nodes by drag and drop from one tree to another. But one of my trees has two nodes with same name. Irrelevant to which of the two nodes I select, the deletion always delete the first node based on…
-2
votes
1 answer

Can we create an empty node(Directory) below the root node

Can we create an empty directy under the root node using dynamic JTree. Eg: Am tyring to create a jtree like this public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if…
John Christy
  • 371
  • 3
  • 6
  • 22
1 2 3
81
82