I'm using a GridBagLayout to align these buttons to the left(WEST) side of the screen. Although i have come across a problem where only one button shows up, the grassTile button. I've tried different positions for the JPanel but nothing seems to work.
What's wrong?
// Grass Tile final JButton grassTile = new JButton(); grassTile.setIcon(new ImageIcon("res/grass.png")); grassTile.setVisible(true); grassTile.addActionListener(new grassTile()); grassTile.setMargin(new Insets(0, 0, 0, 0)); grassTile.setBorder(null); c.gridx = 0; c.gridy = 3; guiPanel.add(grassTile, c); // Stone Tile ImageIcon stone = new ImageIcon("res/stone.png"); JButton stoneTile = new JButton(stone); c.gridx = 0; c.gridy = 4; stoneTile.addActionListener(new stoneTile()); stoneTile.setMargin(new Insets(0, 0, 0, 0)); stoneTile.setBorder(null); guiPanel.add(stoneTile, c); // Floor Tile ImageIcon floor = new ImageIcon("res/floor.png"); JButton floorTile = new JButton(floor); c.gridx = 0; c.gridy = 5; floorTile.addActionListener(new floorTile()); floorTile.setMargin(new Insets(0, 0, 0, 0)); floorTile.setBorder(null); guiPanel.add(floorTile, c);