在上一篇文章中,我们开发了Xtree类,这是一个可重用的组件,继承于Jtree类并能够把XML数据以图形树的形式显示。我们现在就增强这个类, 通过提供给它一个在显示默认的XML树来We will now enhance that class by providing it with a default XML tree to display in the event that an XML file is not supplied at the command-line. 而且,我们还将添加一些错误处理逻辑以便程序不会因为无效的XML而崩溃。