Showing posts with label java program mspaint. Show all posts
Showing posts with label java program mspaint. Show all posts

Friday, 5 February 2016

Java program to open mspaint window

How to open MS Paint using Java Code


              We can open the Microsoft Paint using the Java program listed below

Program:


//A small java program to open Microsoft Paint window on the screen.
import java.util.*;
import java.io.*;

class MSPaint {
  public static void main(String[] args) {
    Runtime rs = Runtime.getRuntime();

    try {
      rs.exec("mspaint");
    }
    catch (IOException e) {
      System.out.println(e);
    }  
  }
}

Output: