Can't set background color for Java frame in Safari

Bug ID# 6297486

 

Under OS 10.4, setting a background color for a frame didn't work for either Safari or Firefox - the frame got a brush metal background. 

Under OS 10.5, setting a background color for a frame works using Firefox 2 but not Firefox 3.  However, it doesn't work using Safari, where a frame gets a very dark gray background.  This is illustrated using the frame that pops up from the applet on this page. 

Is this a bug?  Is there some way of setting the background color in a Java frame in Safari?

A workaround is to add a panel with the desired background color, as illustrated at this link.

If you have any insights, workarounds or comments about this test page please contact Mickey Segal.  A listing of  many Java resources is at this link.

Source code:

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class brush_back extends Applet implements WindowListener {

Frame frame;
Label label;

public void init()
{
    frame = new Frame("A frame");
    frame.setLayout(new GridBagLayout());
    frame.setBounds(100, 100, 600, 300);
    frame.setBackground(Color.yellow);
    label = new Label("Some random label");
    frame.add(label);
    frame.validate();
    frame.show();
    frame.addWindowListener(this);
}

public void windowOpened(WindowEvent we){}

public void windowClosed(WindowEvent we){}

public void windowIconified(WindowEvent we){}

public void windowDeiconified(WindowEvent we){}

public void windowActivated(WindowEvent we){}

public void windowDeactivated(WindowEvent we){}

public void windowClosing(WindowEvent we)
{
    if (we.getSource() == frame)
    {
        frame.setVisible(false);
        frame.dispose();
    }
}

public void paint(Graphics g)
{
    g.drawString("A frame should pop up", 10 , 20);
}
} // END OF Class brush_back