簡體   English   中英

如何從在Java中動態創建的JTree生成XML文件

[英]How to Generate XML file from JTree which is dynamically created in java

幫助我編寫代碼,以從JTree生成xml文件,該文件是通過Java代碼動態創建的。 如何從中生成XML文件? 請解釋。

由於TreeNodes可以序列化,因此可以使用xstream進行序列化。

參見http://www.java-forums.org/xml/25994-how-can-i-create-xml-file-jtree-need-ur-valuable-suggestions.html

即:

System.out.println(   new XStream().toXml(jtree)    );

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM