Document doc = (Document) desc;
HTMLDocument doc = (HTMLDocument) desc; setDocument(doc);
  public void read(InputStream in, Object desc) throws IOException  {    EditorKit kit = getEditorKit();    if (kit instanceof HTMLEditorKit && desc instanceof HTMLDocument)      {        Document doc = (Document) desc;        try          {            kit.read(in, doc, 0);          }        catch (BadLocationException ex)          {            assert false : "BadLocationException must not be thrown here.";          }      }    else    {        Reader inRead = new InputStreamReader(in);        super.read(inRead, desc);      }    }