title: Show 'expand' control on JTree nodes after children are removed?
body: <p>I have a <a href="http://download.oracle.com/javase/6/docs/api/javax/swing/tree/DefaultTreeModel.html" rel="nofollow noreferrer"><code>DefaultTreeModel</code></a> containing a subclass of <a href="http://download.oracle.com/javase/6/docs/api/javax/swing/tree/DefaultMutableTreeNode.html" rel="nofollow noreferrer"><code>DefaultMutableTreeNode</code></a>. I have only overridden <code>isLeaf()</code> to always return <code>true</code> because I lazily load the children when the node is expanded. Then, when the node is collapsed, I remove the children (firing the proper <code>treeNodesRemoved</code> event) because I have unsubscribed from updates from the server.</p>
  
  <p>The problem is that after the user collapses a node and I remove the children, the stupid little expand circle disappears (but clicking that area still works to expand the node). How can I always show the expand control when the children have been removed?</p>
  
  <p>Related: <a href="https://stackoverflow.com/questions/2472634/add-expand-button-to-jtree-node-that-has-no-children">Add 'expand' button to JTree node that has no children?</a>. Is adding a fake child the only way?</p>
  
  <p><img src="https://i.stack.imgur.com/LP2i8.png" alt="Expand control disappears after collapsing"></p>