I have the folowing custom JPanel and I have aded it to my frame using Netbeans GUI builder but the background won\'t change! I can see the circle, drawing with g.fillOval()
You have to call the super.paintComponent(); as well, to allow the Java API draw the original background. The super refers to the original JPanel code.
public void paintComponent(Graphics g){
super.paintComponent(g);
g.setColor(Color.red);
g.fillOval(player.getxCenter(), player.getyCenter(), player.getRadius(), player.getRadius());
}