I have a JFrame inside of which is a jpanel that im using as the content pane.

So basically im using the jpanel to load content into on click. New content is returned as a Jpanel also so its ends up being jpanel -> inside jpanel -> inside Jframe. When i need to load in new content i clear the panel, load the new content and validate() the jframe & jpanel and the new content displays.

My problem is that when the new content displays its clear that the validate method is working because i can see the new interface but i can also see the old interface as if its become the background; i can resize the window and it just disappears and looks as it should.

![enter image description here](https://i.stack.imgur.com/VuvtO.png)
![enter image description here](https://i.stack.imgur.com/LBA34.png)

Is this just the way validate works or can i fix it?

Edit: this worked. The problem was i wasn't calling repaint manually.

```
public BaseWindow setContent(JComponent comp){
    contentPane.add(comp);
    contentPane.revalidate();
    contentPane.repaint();
    return this;
}

```