Use the protected HTMLEditorKit.Parser getParser()HTMLEditorKit.Parser.getParser()
method
instead which returns a ParserDelegator
after properly
initializing the DTD for HTML 3.2.
But this method is protected. Therefore subclass HTMLEditorKit
and override it with a public version.
import javax.swing.text.html.*;
public class ParserGetter extends HTMLEditorKit {
// purely to make this method public
public HTMLEditorKit.Parser getParser(){
return super.getParser();
}
}