mainframe.setLocation(null);
Why? Maybe you mean setLocationRelativeTo(null), which will centre your window. That is your first problem anyhow.
Your "Map" array is of length 16, 0 - 15, how do you...