richard_fairall
asked on
JTree: How to remove rootHandles from all nodes in SOME trees in an application
Hi
I need to remove rootHandles from some trees in the application.
So, I can't set a general UIDefault or something like that to affect all trees.
showRootHandles(false) only operates on the root node as far as I can see.
Thanks
I need to remove rootHandles from some trees in the application.
So, I can't set a general UIDefault or something like that to affect all trees.
showRootHandles(false) only operates on the root node as far as I can see.
Thanks
The UI properties should only apply to any trees created *after* you change the property.
ASKER
Thanks for the replies (the one for connecting lines as well).
The connecting lines job works fine, using UIManager.put("Tree.paintL ines", Boolean.FALSE);
However, I can't get rid of rootHandles on all nodes using UIManager.put("Tree.showsR ootHandles ", Boolean.FALSE);
Is this the correct default string? and Where on earth (Switzerland at the moment) do I find definitions of
the strings for the default UI stuff?
By the way, it's beer'oclock.
Thanks.
The connecting lines job works fine, using UIManager.put("Tree.paintL
However, I can't get rid of rootHandles on all nodes using UIManager.put("Tree.showsR
Is this the correct default string? and Where on earth (Switzerland at the moment) do I find definitions of
the strings for the default UI stuff?
By the way, it's beer'oclock.
Thanks.
What L&F are you using?
ASKER
Several look and feels,
Windows, EclipseL&F, Metal, most are Jidesoft things.
Perhaps I have to set the UIDefault for showsRootHandles before
creating a node?
Windows, EclipseL&F, Metal, most are Jidesoft things.
Perhaps I have to set the UIDefault for showsRootHandles before
creating a node?
I would have thought the follwoing would work:
tree.setShowsRootHandles(f alse);
Let me check and get back to you.
tree.setShowsRootHandles(f
Let me check and get back to you.
try setting UImanager properties "Tree.expandedIcon" and "Tree.collapsedIcon" to null.
ASKER
Tried the following:
UIManager.put("Tree.expand edIcon", null);
UIManager.put("Tree.collap sedIcon", null);
No change, little boxed + or - icon still there.
UIManager.put("Tree.expand
UIManager.put("Tree.collap
No change, little boxed + or - icon still there.
What L&F did u test it on?
ASKER
I have tried 6 different LAFs: Windows, eclipse metal, xerto (all from JideSoft inc)
They all still show the doobries.
Code is:
UIManager.put("Tree.paintL ines", Boolean.FALSE);
UIManager.put("Tree.showsR ootHandles ", Boolean.FALSE);
UIManager.put("Tree.expand edIcon", null);
UIManager.put("Tree.collap sedIcon", null);
and:
tree.putClientProperty("JT ree.lineSt yle", "None");
renderer.putClientProperty ("JTree.li neStyle", "None");
tree.setShowsRootHandles(f alse);
tree.setRootVisible(false) ;
The lines dont show.
They all still show the doobries.
Code is:
UIManager.put("Tree.paintL
UIManager.put("Tree.showsR
UIManager.put("Tree.expand
UIManager.put("Tree.collap
and:
tree.putClientProperty("JT
renderer.putClientProperty
tree.setShowsRootHandles(f
tree.setRootVisible(false)
The lines dont show.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OmiGawd
I forgot this trick! Works fine.
How to I find out about these resources like "Tree.expandedIcon" ?
I forgot this trick! Works fine.
How to I find out about these resources like "Tree.expandedIcon" ?