Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Best Component for displaying XML?  RSS feed

 
Sanjit Singh
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,<p>
I would like to display well formed XML in a swing GUI. The main point that I would like to achieve is the "indentation", so that the user can easily read the xml file.
Does anyone have any ideas about which component is best to use in this scenario? Any code would also be very helpful!
As of now, I have a JTextArea, but the xml is not indented. Thus, looking forward to a way to indent xml so that it is user readable.
Thanks!
P.S: any other way except JTree?
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the JTextArea and put the spacing in yourself. Make sure to use a mono-spaced font.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!