Abrir un archivo de texto en el bloc de notas
Les dejo un fragmento de código para abrir un archivo de texto en el bloc de notas, obviamente en windows.public static void main(String []args){ try { Runtime obj = Runtime.getRuntime(); //La instrucción es notepad para abrir el bloc de notas, espacio //y la ruta donde esta el archivo obj.exec("notepad "+System.getProperty("user.dir")+"\\Archivo.txt"); //Pueden usar System.getProperty("user.dir") Obtiene la ruta del proyecto } catch (IOException ex) { System.out.println("IOException "+ex.getMessage()); } }
0 Comentaron...: