How to use the setBackground() method? (JFrame)

I'm want to make a JFrame with black background.

I tried to use the setBackground() method, but didn't work.

The background changes to black, but after it returns to white(quickly).

Here's my code:

// ***********************

// Game.java

// ***********************

import javax.swing.*;

import java.awt.*;

publicclass Game{

publicstaticvoid main (String args[]){

JFrame window =new JFrame("Bruno's Game");

window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

window.setSize(320,240);

window.setLayout(null );

window.setBackground(new Color(0,0,0) );

window.setVisible(true );

}

}

Does anyone have some tips?

Thank's.

[1345 byte] By [Bruno_Grassellia] at [2007-11-27 8:56:22]
# 1
//window.setBackground( new Color(0,0,0) );window.getContentPane().setBackground( new Color(0,0,0) );
Michael_Dunna at 2007-7-12 21:19:10 > top of Java-index,Java Essentials,New To Java...
# 2
Thank you very much.
Bruno_Grassellia at 2007-7-12 21:19:10 > top of Java-index,Java Essentials,New To Java...