sorry if this is obvious, but I've been looking for days and I can't seem to find the answer.
Here is the situation. I am trying to read from an rtf file located within a jar file and then display it in a JEditorPane. This is working from the Netbeans environment, but not when executing the jar file in the dist folder. A version of this question has been asked before, but for my application I think I don't think the previous answers apply. (The reason is that JEditorPane.read requires a FileInputStream, and all of the solutions to other problems I have seen have involved non-File InputStreams. Here is the code in question:
descPane = new JEditorPane("application/rtf", "");
try {
File test = new File(this.getClass().getResource("files/general.rtf").toURI());
descPane.read(new FileInputStream(test), null);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Any help is very appreciated! Thank you!