Netbeans JTree线型 [英] Netbeans JTree Linestyle
问题描述
我很难使用Netbeans删除JTrees中的"lineStyle"行.在独立程序中,我可以做到这一点:
I'm having difficulties removing the "lineStyle" lines in JTrees using Netbeans. In a standalone program, I'm able to do this:
JTree myJTree = new JTree();
myJTree.putClientProperty("JTree.lineStyle", "None");
JScrollPanel myScrollPanel = new JScrollPanel();
myScrollPanel.setViewportView(myJTree);
但是当我尝试将该代码添加到我的Netbeans创建的GUI中时,得到的似乎是"Windows Default"线型.关于我在做什么错的任何想法吗?
But when I try adding that code into my Netbeans created GUI, I get what appears to be a "Windows Default" linestyle. Any ideas on what I'm doing wrong?
推荐答案
NetBeans设置了它自己的系统范围的UI.
NetBeans sets it own system-wide UI.
您可以通过在JTree上覆盖setUI或updateUI方法来解决此问题,除了调用超级实现方法之外,您还需要进行客户端属性设置.
You can fix this by overriding setUI or updateUI methods on your JTree, where in addition to calling super implementation method you would do your client property setting.
这篇关于Netbeans JTree线型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!