Class XMLTextEditor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class XMLTextEditor extends JEditorPane
Simple Text Component to edit xml document with integrated undo / redo behaviour. If you looking for how to create editor component with syntax highlight, just create any JEditorPane and supply it with XMLEditoKit eg:
 JEditorPane editor = new JEditorPane();
 editor.setEditorKitForContentType(XMLEditorKit.XML_MIME_TYPE, new XMLEditorKit();
 editor.setContentType(XMLEditorKit.XML_MIME_TYPE);
 
See Also:
  • Field Details

  • Constructor Details

    • XMLTextEditor

      public XMLTextEditor()
      Creates a new instance of XMLEditorPane
  • Method Details

    • setText

      public void setText(String t)
      Overrides:
      setText in class JEditorPane
    • undo

      public void undo()
      Undo
    • redo

      public void redo()
      Redo
    • gotoLine

      public void gotoLine(int line)
      Move the cursor to the specified line if exception occur cursor not change
      Parameters:
      line - the specified line number