views:

222

answers:

1

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);

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?

+1  A: 

NetBeans sets it own system-wide UI.

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.

eugener