Container pane = this.getContentPane();
cleanContentPane();
JPanel envelope = new BackgroundPanel();
envelope.setLayout(new GridBagLayout()); //to have centered inner panel
envelope.add(connectGamePanel = new ConnectGamePanel(this));
pane.add(envelope, BorderLayout.CENTER);
pane.setVisible(true);
}