JViewerPanel jviewer = new JViewerPanel();
String text = FileUtils.readFileToString(file);
jviewer.update(text);
dialog.add(jviewer);
} else if (verifier.isRTF(path)) {
RTFEditorKit rtf = new RTFEditorKit();
JEditorPane editor = new JEditorPane();
editor.setEditable(false);
editor.setEditorKit(rtf);
// This text could be big so add a scroll pane.
JScrollPane scroller = new JScrollPane();
scroller.getViewport().add(editor);
dialog.add(scroller);
// Load an RTF file into the editor.
try {
FileInputStream fi = new FileInputStream(file);
rtf.read(fi, editor.getDocument(), 0);
} catch (Exception exception) {
exception.printStackTrace();
}
} else if (verifier.isPicture(path)) {
AlphalinePanel viewer = new AlphalinePanel();