[Solved] How do I get rid of the gaps between the tiles?
You need to add the JButton to mainPanel instead of panel. Some duplicated lines and not necessary settings removed for (int i = 0; i < 64; i++) { label[i] = new JButton(); label[i].setBorderPainted(false); mainPanel.add(label[i]); label[i].setIcon(new ImageIcon(getClass() .getResource(“”))); label[i].setPreferredSize(new Dimension(50,…