Dear forum users.
Im trying to make a game, and at the moment im having a problem with letting a JLabel with a background being disiplayed.
The label itself, with its content works great.
The problem is when i clear the JPanel that is over the JLabel, (g.clearRect), its like it removed the opaque, or fills the JPanel with standard color..
g.clearRect(0, 0, getSize().width, getSize().height);
if (parent.getCurrentMap() != null) {
parent.getCurrentMap().draw(g, viewInvis);
}
if (selectedElement != null) {
selectedElement.draw(g, mousePosition.x, mousePosition.y);
}
It works fine as long as i dont call repaint on the JPanel..
Anyone know why this happend? Or how i can get past it?