JPanel panel = new JPanel( new BorderLayout() );
JLabel label = new JLabel( url );
label.setBorder( BorderFactory.createEmptyBorder( 3, 3, 3, 3 ) );
panel.add( label, BorderLayout.NORTH );
JXEditTextArea inputArea = JXEditTextArea.createXmlEditor( false );
StringWriter writer = new StringWriter();
// XmlUtils.serializePretty( XmlObject.Factory.parse( content ), writer
// );
XmlUtils.serializePretty( XmlUtils.createXmlObject( content ), writer );
String xmlString = writer.toString();
// reparse so line numbers are correct
// XmlObject xmlObject = XmlObject.Factory.parse( xmlString, new
// XmlOptions().setLoadLineNumbers() );
XmlObject xmlObject = XmlUtils.createXmlObject( xmlString, new XmlOptions().setLoadLineNumbers() );
inputArea.setText( xmlString );
inputArea.setEditable( false );
inputArea.getPainter().setLineHighlightEnabled( true );
JPanel p = new JPanel( new BorderLayout() );
p.add( inputArea, BorderLayout.CENTER );
p.add( new LineNumbersPanel( inputArea ), BorderLayout.WEST );