Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Brandon McCombs" Subject: how to have empty nodes i Message-ID: <45c18664$0$1414$4c368faf@roadrunner.com> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 25 Date: Wed, 27 Apr 2011 15:29:58 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918198 96.60.20.240 (Wed, 27 Apr 2011 10:29:58 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:29:58 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:854 To: comp.lang.java.gui It seems in Sun's infinite wisdom that a node in a JTree must have at least 1 child in order for there to be an expansion control next to the node. I don't want to load my tree structure all at once and so I'm getting each node's children a node at a time when it is either selected or expanded. But I still want the stupid expansion control so I'm creating a fake node temporarily. This does the job except that when a node is expanded for the first time I get a quick blink where the dummy node is being deleted before the real nodes show up. I don't know why this happens since I'm only reloading the tree at the selected node one time so I was wishfully thinking that I wouldn't even notice 1 node being removed and a bunch of others being added but I do. Do I have to go to the trouble of creating my own tree expansion listener (disable the listener, then remove the dummy node, reload the tree at the selected node, add the real nodes, then enable the listener and reload again?) just for this stupid little feature that should already be there? What can I do to fix it? thanks --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24