Monday, 25 January 2016

Java Program to open a Notepad window

Notepad window open program using Java Code

How to open Notepad using Java

We can open the Windows Notepad using Java code. The below Java program shows how to open a Notepad Window in Java


//A small java program to open Notepad window on the screen.

import java.util.*;
class Notepad 
  public static void main(String[] args) 
      Runtime rs = Runtime.getRuntime();
       catch (IOException e)



Runtime : Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method.

getRuntime : Returns the runtime object associated with the current Java application. Most of the methods of class Runtime are instance methods and must be invoked with respect to the current runtime object.

No comments :

Post a Comment