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.*;
public class Game {
public static void 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.