Open a NotePad in Java.

satheesh

New Member
Messages
883
Reaction score
0
Points
0
Code:

Code:
class Notepad{
    public static void main(String arg[]){
        Runtime r=Runtime.getRuntime();
        Process p=null;
        
        try
        {
            p=r.exec("notepad");
            p.waitFor();
        }
        catch(Exception e)
        {
            System.out.print("Fail to Open Notepad Opened");
        }
        System.out.print("Notepad Closed"+p.exitValue());
    }
    
}

Save as "Notepad.java" and Compile and Run it.

Good Luck.
 

brianfast

New Member
Messages
19
Reaction score
0
Points
0
Very nice code snippet. However its not a tutorial and it lacks a lot of features people would like.
 

Thewinator

New Member
Messages
256
Reaction score
0
Points
0
Indeed, for instance. Defining a file to open in notepad would be a good addition.
 
Top