This is a fragment of the code I used to solve this problem.
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 457, 330);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JLayeredPane panel = new JLayeredPane();
panel.setBounds(0, 0, 457, 330);
frame.getContentPane().add(panel);
panel.setLayout(null);
JPanel background = new JPanel();
background.setBounds(0, 0, 457, 330);
panel.add(background);
background.setLayout(new MigLayout("","",""));
//In my particular problem I used some constraints, but they're not needed
backgroundLabels = new JLabel[NCOLS][NROWS];
for (int i = 0; i < NCOLS; i++)
for (int j = 0; j < NROWS; j++) {
backgroundLabels[i][j] = new JLabel(backgroundIcon);
//Assuming you have a backgroundIcon variable where you saved your icon
background.add(backgroundLabels[i][j], "cell " + i + " " + j);
}
JPanel characterPanel = new JPanel();
panel.setLayer(characterPanel, 1);
characterPanel.setBounds(0, 0, 457, 330);
panel.add(characterPanel);
characterPanel.setOpaque(false);
characterPanel.setLayout(new MigLayout("","",""));
characterLabels = new JLabel[NCOLS][NROWS];
for (int i = 0; i < NCOLS; i++)
for (int j = 0; j < NROWS; j++) {
characterLabels[i][j] = new JLabel("");
//Creates empty character labels. You can then add icons using setIcon()
characterPanel.add(characterLabels[i][j], "cell " + i + " " + j);
}
}