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:




2 comments :

  1. Here is a sneak-peak into what academic writing is all about, especially for those who want to make a career in this field of writing. See more java homework solutions

    ReplyDelete
  2. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete