• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

JTree: hide the connecting lines between nodes on selected trees.

Hi

I need to hide the connecting lines on some trees in our application, (but not on all trees).
The app uses a number of look and Feels (some from JideSoft inc) for Windows and Metal.
I have experimented with     tree.putClientProperty("JTree.lineStyle", "None");
but this only works on Java look and feel, not Windows types.
I have also tried     UIManager.put("Tree.paintLines", Boolean.FALSE);
but this turns them off across the entire application.

Any ideas?
Thanks


0
richard_fairall
Asked:
richard_fairall
  • 3
  • 2
1 Solution
 
Mig-OCommented:
what exactly do you want? Disable all lines just for the windowLAF-Trees?
If you just want to disable them on some trees, why would you want to set a global property? And why don't you disable them just for the trees in which you don't need them?
0
 
richard_fairallAuthor Commented:
Thanks for the reply Mig-O but...

The first line states that I only want to set this option on specific trees in the application,
ie not all trees and therefore a global option is not possible.
Some trees have the lines, others don't.

The second line states that I need to do this for a number of look and feels (Windows and Java types)
The behaviour for all trees, with or without lines, must be consistent across all Look and Feel types.

You asked why don't I disable them just for the trees in which I don't need them ...
that's the solution I am asking for!

0
 
Mig-OCommented:
I think that a possibility maybe that you set the global option before creating the tree, because thats the point i think, when it is initialized, and afterwards, you reset the global option. Dirty hack, it seems (And i don't know if it works, because changing an UI Property should make those trees receiving a property change event.).

Or... if you know which trees you want to change... try something like getUI(), cast to the appropriate UI list MetalTreeUI, and then interact directly with the UI. Or maybe, you generate property-Change-Events for the global properties yourself, and send them to the ui (even dirtier hack ;)
0
 
richard_fairallAuthor Commented:
Thanks again Mig-O
I'm a bit disappointed, this is the first time I have not received a clear answer to a question,
although, my colleagues say I've been really lucky in the past.
I'm surprised this is not a more common requirement but so la la.
I'm not sure where to go with this next, perhaps I should ask again in a short while.
Thanks

0
 
Mig-OCommented:
I am sorry, not being able to help out more. maybe you can ask the question again with other words, and send "objects" or "CEJH" an mail to look at the question.
0

Featured Post

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now