Link to code: PercolationStats.java

import javax.swing.JOptionPane;

import princeton.*;

/****************************************************************************
 * From Princeton COS 226, Kevin Wayne
 * Modified by Owen Astrachan, January 2008
 * Modified by Jeff Forbes, October 2009
 ****************************************************************************/
public class PercolationStats {

    public static void main(String[] args) {
    	    int N, T;
    	    if (args.length == 2) { // use command-line arguments for testing/grading
    	    		N = Integer.parseInt(args[0]);
    	    		T = Integer.parseInt(args[1]);
    		}
    	    else {
    	    		String input = JOptionPane.showInputDialog("Enter N and T", "20 100");
    	    		// TODO: parse N and T from input
    	    }
    	    
        // TODO: Perform T experiments for N-by-N grid
        
        // TODO: print statistics and confidence interval   
 
    }
}