Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v retrieving revision 1.20 diff -u -r1.20 GtkContainerPeer.java --- gnu/java/awt/peer/gtk/GtkContainerPeer.java 7 Jan 2004 02:23:37 -0000 1.20 +++ gnu/java/awt/peer/gtk/GtkContainerPeer.java 13 Jan 2004 19:19:06 -0000 @@ -39,6 +39,8 @@ package gnu.java.awt.peer.gtk; import java.awt.AWTEvent; +import java.awt.Color; +import java.awt.Component; import java.awt.Container; import java.awt.Graphics; import java.awt.Insets; @@ -136,4 +138,23 @@ public void beginLayout () { } public void endLayout () { } public boolean isPaintPending () { return false; } + + public void setBackground (Color c) + { + super.setBackground(c); + + Object components[] = ((Container) awtComponent).getComponents(); + for (int i = 0; i < components.length; i++) + { + Component comp = (Component) components[i]; + + // If the child's background has not been explicitly set yet, + // it should inherit this container's background. This makes the + // child component appear as if it has a transparent background. + // Note that we do not alter the background property of the child, + // but only repaint the child with the parent's background color. + if (!comp.isBackgroundSet() && comp.getPeer() != null) + comp.getPeer().setBackground(c); + } + } }