I'm having difficulty removing lineStyle strings in JTrees using Netbeans. In a standalone program, I can do this:
JTree myJTree = new JTree(); myJTree.putClientProperty("JTree.lineStyle", "None"); JScrollPanel myScrollPanel = new JScrollPanel(); myScrollPanel.setViewportView(myJTree);
But when I try to add this code to my created Netbeans GUI, I get what linuxyle seems to be by default Windows. Any ideas on what I'm doing wrong?
NetBeans installs its own system-wide interface.
You can fix this by overriding the setUI or updateUI methods on your JTree, where in addition to calling the super-execution method, you must configure your client.
Calling the following removes rows from JTrees worldwide in Swing
UIManager.put("Tree.paintLines", Boolean.FALSE);
(Not sure how this interacts with NetBeans, though, sorry.)