How to remove elements from a document?

I loaded a html document in HTMLDocument, but I don't know how to remove elements. HTMLDocument.remove (int, int) only gives me an exception The length of the document returns 0 but there are 3 block elements and a run element in it.
[248 byte] By [ddecavele] at [2007-9-26 2:44:44]
# 1
In February I wrote a feature request about this. Today it has been accepted to the bug database. Please make your vote: http://developer.java.sun.com/developer/bugParade/bugs/4760082.html
mbeyer73 at 2007-6-29 10:25:27 > top of Java-index,Archived Forums,Swing...
# 2
Hi,I posted a solution to your question in a similar thread, please see http://forum.java.sun.com/thread.jsp?forum=57&thread=185404Ulrich
uhilger at 2007-6-29 10:25:27 > top of Java-index,Archived Forums,Swing...