The JFrame will not paint and stay!

Well first the netbeans gui i have flashes whatever silly color i choose and then goes back to default grey. So I got out of that and using a simple editor the code below behaves the same. It just flashes green for a split second and returns to default color? I am using recent JDK download and Win XP .
JFrame j = new JFrame();
j.setSize(100,100);
j.setBackground(new java.awt.Color(153, 255, 153));
j.setVisible(true);
advice appreciated thx.
Message was edited by:
rigidyg

Because a JFrame put a container on top, where components are put.
Add this line:
j.getContentPane().setBackground(new java.awt.Color(153, 255, 153));

Similar Messages

Maybe you are looking for