Java Utililty Methods Swing RTF

List of utility methods to do Swing RTF

Description

The list of methods to do Swing RTF are organized into topic(s).

Method

StringRTF2TXT(String Str)
RTFTXT
if (Str != null && Str.startsWith("{\\rtf1") == true) {
    Str = RTF_CELL_PATTERN.matcher(Str).replaceAll(". $0");
    RTFEditorKit RTF = new RTFEditorKit();
    Document doc = RTF.createDefaultDocument();
    RTF.read(new StringReader(Str), doc, 0);
    Str = doc.getText(0, doc.getLength());
return Str;
...
StringrtfToPlain(String rtf)
rtf To Plain
RTFEditorKit rtfParser = new RTFEditorKit();
Document document = rtfParser.createDefaultDocument();
try {
    rtfParser.read(new ByteArrayInputStream(rtf.getBytes()), document, 0);
    return document.getText(0, document.getLength());
} catch (Exception e) {
    throw new RuntimeException("Error converting RTF to plain text", e);