public class PictureCollage4{ public static void main(String args[]){ //method uses crop and compose to tile a picture FileChooser.setMediaPath("C:/Documents and Settings/Administrator/My Documents/My Pictures/"); Picture p = new Picture(FileChooser.getMediaPath("tn_buster.jpg")); Picture canvas = new Picture(p.getWidth(),p.getHeight()); //y coordinate incrementing (source is 32 pixels wide & increments to the target 35 pixels) // starts at sourcey = 0 takes from the picture till sourcey is no more than 100 pixels from y-axis edge for(int sourcey = 0, targety=0; sourcey < p.getHeight() - 30; sourcey+=30, targety+=35){ //x coordinate incrementing (source is 32 pixels wide & increments to the target 35 pixels) //starts at sourcex = 60 takes from the picture till sourcey is no more than 60 pixels from the x-axis edge for(int sourcex = 60, targetx=0; sourcex < p.getWidth() - 30; sourcex+=30, targetx+=35) p.crop(sourcex, sourcex+32 , sourcey, sourcey+32).compose(canvas, targetx, targety); } canvas.show(); canvas.write("C:/Documents and Settings/Administrator/My Documents/My Pictures/busterTile.jpg"); }}