I should open a .txt file on my java application, so i’ve searched a way to do this but what i’ve found is only java calls to operating system, writing console commands. There is a way to open a .txt file independently of operating system of the user?
Note that I want to open an application that reads .txt, not only its content! I’m wondering if there is a way to call default application for reading .txt, without write for example “notepad myTxt.txt” on console from java 🙂
I should open a .txt file on my java application, so i’ve searched a
Share
You can use
Desktop.open()From the Javadocs:
http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html#open(java.io.File)
An alternative (because you mentioned “editing”) might also be
Desktop.edit()