My book says to use the screen.setBackground(Color.white) to set the background color of my applet to white. However, when I compile this, I get an error. Is this setBackground method only available in certain versions of java? If not, anyone have any ideas why it might be throwing this error and not compiling? Thanks.
what is this screen variable you are using. did you set it up using Container screen = getContentPane(); that is the way you are supposed to access the content pane when using swing applets or applications. if you aren't using swing im not sure what the problem is. ------------------ I hope its helps, feel free to email me noahcarroll@juno.com
I don't know if this is the "right" way to do it, but I do the following to set the background color: public void init() { setBackground(Color.white); // etc } ------------------ - Daniel
Okay, that worked. For everything else so far, I was declaring my Graphics object like: and then setting properties like this:
so naturally, I thought that to set the background color it would just be s.setBackground(Color.white); but it turned out just to be setBackground(Color.white). Thanks!!! [This message has been edited by tyler jones (edited December 07, 2000).]
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad: