Does anyone know that how to call the Notepad Editor in my JavaProgram. Basically, I have a output file in HTML formet and Now, Iwould like to create a button and when user hit the button Notepad orVisual Dev should pop up.Right now I am looking in this linkjava.sun.com/.../PropertyEditor.html .This link talk about PropertyEditor function. So, can you please letme know if that is the right approch to start it. I would be reallyappriciated.
You may use thethe exec() method os the Runtime class then pass is the name of theshell( system command ) something like:try{Process proc = Runtime.getRuntime().exec("Notepad.exe");BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));String line;while ((line = br.readLine) != null){ /* do something with output */ }int returnValue = proc.waitFor();br.close();}catch (Exception e) // should probably be a bunch of catchstatements here...{ /* do something with exception */ }This is similar to System("Notepad.exe"); statement in C.I have never actually compiled this code but think you got the idea.
if u wants to open a note pad just follow itRuntime, Process class of the java gives such facility , after that writecommand,p.exec("notepad");where p is the object of class Process.