Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Jtree node view

Posted on 1998-11-19
4
Medium Priority
?
225 Views
Last Modified: 2010-03-30
in my application, I've created a JTree.
in this tree there are folders and leaves, but the leaves are all the nodes that has no suns and they are painted as folders.
i want to control on the when it will paint the node as not a folder (even if it doesn't have sons).
how can i do it?
0
Comment
Question by:rzvika3
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 60 total points
ID: 1227787
you have to implement your own TreeCellRenderer

you can found such an example with your Swing distribution . (I think it name was TreeDemo or something very similiar ...)

if you have some more concrete problem, post it here
hope this helps
  heyhey
0
 

Author Comment

by:rzvika3
ID: 1227788
sorry for not answering your answer.
i know that there are ways to draw,put icon etc. in a node.
as you know from the windows, even if there aren't any children in a folder it still looks as a folder and not as a file.
when you create a node, you specify whether it can have children or not.
is there a way that the drawing of the tree will get this information and according to that it will make it looks like a folder or a file?
thank you.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227789
you can modify the look&feel of the tree icons (folders/files) by implementing your own tree cell renderer, and there is such an example in your swing examples subdirectory ...

or you have some other problem ?
  heyhey

0
 

Author Comment

by:rzvika3
ID: 1227790
thank you!
if you can tell me about more example places, please do.
z.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses

963 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