从RTF文件中提取内容时出现以下错误。
javax.swing.text.rtf.RTFReader $ AttributeTrackingDestination.handleKeyword(RTFReader.java:1279)
JEditorPane p = null;
EditorKit rtfKit = null;
EditorKit txtKit = null;
Writer writer = null;
int[] filesCount = null;
try {
p = new JEditorPane();
p.setContentType("text/rtf");
rtfKit = p.getEditorKitForContentType("text/rtf");
rtfKit.read(new FileReader(fileName), p.getDocument(), 0);
rtfKit = null;
txtKit = p.getEditorKitForContentType("text/plain");
writer = new StringWriter();
txtKit.write(writer, p.getDocument(), 0, p.getDocument().getLength());
String paragraphs = writer.toString();