Code:
gui1[0].addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
panelTop.remove(game.gui1[1]);
}
});
gui1[] is an array of JButtons. I added them to the panel by this:
panelTop.add(game.gui1[0]);
panelTop.add(game.gui1[1]);
panelTop.add(game.gui1[2]);
Whenever I click gui1[0] JButton, it doesn't disappear! It looks like it's pressed (blackened), and it stays like that. I can't click it, but I still see it. :( How do I make it disappear?