Disabling the collapse event of the JTree is possible by adding a listener to it. There may be times where you want your JTree to be always in expanded mode hence disabling its collapse event is the only way to go.
Add a TreeWillExpandListener to the JTree, make the treeWillCollapse() method throw ExpandVetoException and that should do it.
So I had a JTextPane that displays text in HTML format. The color issue arises when I disable the JTextPane. A workaround to this is to use the setEditable() method instead of setEnabled().
Then again, another issue arises. You will be able to select the text even though you cannot insert or remove characters in the JTextPane. If you do not want the JTextPane to have a selection feature if it is not editable, then only way to make it work is to override its protected method processMouseEvent().