Since it is an array it repeats till the end of the loop. But Room 1 should not be repeated . it should be place at the top
first[ind] = new JLabel("<html>"
+ "<body>"
+ "<div id=r12style=border: 3px solid orange; margin-bottom: 5px;>"
+ " <h2>"
+ " Room 1"
+ " </h2>"
+ "<img src=" + icon + " width=\"95\" height=\"105\"></img>"
+ "</div>"
+ "</body>"
+ "</html>");
Room 1