-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.3
-
None
-
x86
-
windows_95
Name: tb29552 Date: 09/22/97
Components don't inherit parent container's background color,
but they do inherit parent container's foreground color.
Run the code supplied. The background color of the
button and list don't change even though the Frame sets its
background color to blue, but the foreground color
is inherited from the Frame (white).
On Solaris this works just fine.
import java.awt.*;
import java.awt.event.*;
public class MyFrame extends Frame
{
public MyFrame() {
super();
add("North",new Button("Here is the button"));
List l = new List(4);
l.add("Item 1");
l.add("Item 2");
l.add("Item 3");
l.add("Item 4");
l.add("Item 5");
add("South",l);
setBackground(Color.blue.darker());
setForeground(Color.white);
}
public static void main(String [] args) {
MyFrame f = new MyFrame();
f.setSize(200,200);
f.setVisible(true);
}
}
company - AT&T , email - ###@###.###
======================================================================
- duplicates
-
JDK-4062916 WinNT: setBackground() doesn't set background color for dialogs; does on Solaris
-
- Closed
-