java classcast exception
- by shil
hi
i have problems in converting an XML document type into a Document object..
this is the piece of code
line 1 : Document doc=null;
line 2 : doc = (Document) parser.parse(sourceFile);
for this line 2 it throws java classcast exception..
without the typecast it shows error as
"Type mismatch: cannot convert from org.w3c.dom.Document to javax.swing.text.Document"
how do i now typecast properly? any suggestions??