How to Open a Text File with Notepad using JAVA in NetBeans





Here I used Runtime class and Process class to execute the command for opening notepad
1. Create a main class.
2. Enter code in main method {
Runtime rt=Runtime.getRuntime();
String file="path of your file";
Process p=load.exec("notepad "+file);              // a space is required after notepad
3. Run the File.
4. Finish

Like My Facebook Page for more video updates:
https://www.facebook.com/pages/Raks/335960303097841

Comments

Popular posts from this blog

How to Perform DES Encryption and Decryption of TXT file in JAVA with NetBeansIDE

How to Detect CapsLock key using Java in NetBeansIDE.

How to insert Image in MySQL Database with Java in NetBeansIDE