JPanel setBackground (Color.BLACK) não faz nada
Eu tenho o custom customizado JPanel e eu o adiro ao meu frame usando o construtor Netbeans GUI, mas o background não vai mudar! Eu posso ver o círculo, desenhando com g.fillOval (). O que há de errado?
public class Board extends JPanel{
private Player player;
public Board(){
setOpaque(false);
setBackground(Color.BLACK);
}
public void paintComponent(Graphics g){
super.paintComponent(g);
g.setColor(Color.red);
g.fillOval(player.getxCenter(), player.getyCenter(), player.getRadius(), player.getRadius());
}
public void updatePlayer(Player player){
this.player=player;
}
}