This is a simple java program which renders diffraction pattern via a square aperture. You can set the parameters by passing them to Diffraction constructor. If you call the default constructor, some preset default parameters will be used. I have included 2 sample results (dif.jpg and dif3.jpg).
I have used some libraries from (http://introcs.cs.princeton.edu/java/home/)