Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding a Comment between Parent and Child in JTree

Posted on 2004-08-26
8
Medium Priority
?
250 Views
Last Modified: 2010-03-31
Hi

I would like to add a Comment between a Parent and a child in a JTree, Is this possible, if yes..pls help me with code snippet.

My reqt is like this.

o [] Root 1                                
|     THIS IS COMMENT    (String between parent & child)
       [] Child 1
       [] Child 2
 o-[] Root 2

Any suggestion..

Thanks,
0
Comment
Question by:vibhav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11908270
thats just another child node isn't it.
0
 

Author Comment

by:vibhav
ID: 11908284
Yes, but I do not want to display any icon to this node (like leaf or root (folder icon).

How to renderer it.
0
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 11908387
use a custom tree cell renderer and only display an icon on the nodes that need one.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 18

Expert Comment

by:armoghan
ID: 11909978
and how to remove Icons and show only text
see http://www.objects.com.au/java/examples/swing/TextOnlyTree.do

Thanx to Objects for putting such nice examples together;)
0
 
LVL 16

Expert Comment

by:Valeri
ID: 11910867
Why you need comment in this way?!?! In your custom tree cell renderer you can add tool tip for each one of the nodes. Just have a look at DefaultTreeCellRenderer and write your own in the same way...
0
 
LVL 92

Expert Comment

by:objects
ID: 11918384
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question