I would like my JEditorPane to process any text file as html file.
String file = "cube.obj";
JEditorPane t = new JEditorPane();
t.setEditable(true);
try {
URL url = new URL(getCodeBase(), file);
t.setPage(url);
} catch (NumberFormatException | IOException e) {
e.printStackTrace();
}
Is it possible? My first idea was to read my text file line by line and add these lines to editor pane, but is there any more "elegant" solution?