how can I (read) different types of files in my program (pdf, txt, word or excel) and display them on JEditorPane?
My programme is taking any type of files and open them in himself.
I already tried
public void displaydata(String path){
    File file = new File(path);
    display.setPage(file.toURL());
}
I get correct data only with txt files.
I get strange output with pdf.