package Unit3_Mod2;


public class ImageExample2 {

public static void main (String[] argv)
{
// A 5 x 6 2D array:
int[][] A = {
{50, 55, 60, 65, 70, 75},
{80, 85,90, 95, 100, 105},
{110, 120, 125, 130, 135, 140},
{145, 150, 155, 160, 165, 170},
{175, 180, 185, 190, 195, 200},
};

// Add one pixel on each side to give it a "frame"
int[][] B = frameIt (A);

ImageTool im = new ImageTool ();
im.showImage (B, "test");
}

public static int[][] frameIt (int[][] A)
{
// Declaring the new 2d array to store the frame with the image
int b[][] = new int[6][7];

for(int i = 0; i < 6; i++){
for(int j = 0; j < 7; j++){
// If i or j are at the borders
if(i == 0 || j == 0 || i == 5 || j == 6)
b[i][j] = 0;
else
b[i][j] = A[i][j];
}
}
return b;
}

}
In java, change black frame color to white frame color