Background color fro JFrame

I have used setbackground() method to set the background of jframe.But at start it just show that for a second and goes out and default color comes.what should I do?
[179 byte] By [JTable_need_infoa] at [2007-11-26 22:15:58]
# 1
set Background of frame's content pane
hellbindera at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...
# 2
I have other components directly added to frame.I don't have container to add other component.Otherwise I have to add all component new container and then add that container to frame.thank you
JTable_need_infoa at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...
# 3
if You add them directly to frame they are "forwarded" straight to it's content pane. Try:frame.getContentPane().setBackground(Color.CYAN);
hellbindera at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...
# 4
oh gr8 it's working thank you sir.but what is problem with setBackGround()?
JTable_need_infoa at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...
# 5

first of all there is no such method. :)

You can try:

frame.setBackground(Color.CYAN);

frame.setContentPane(null);

but I'm not sure if You'll not get NPE. Basically What You were doing was:

1) setting frames Background;

2) filling the frame with content pane having it's own background and being opaque

hellbindera at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...
# 6
setBackground(Color color) this is a method I was using.By mistake i just written "setBackGround()"thank you for help
JTable_need_infoa at 2007-7-10 11:08:47 > top of Java-index,Desktop,Core GUI APIs...