you must completely fill in the background in a non-opaque color.
I doubt the 'non-opaque color' part might be a typo
I think it is a typo, otherwise, like you, I don't know what they are trying to say.
Just using setOpaque(true), does NOT make a component opaque. It simply tells the the RepaintManger not to search the ancestor tree to find an opaque component. This makes painting more efficient if it doesn't need to search all the way up to the content pane of the window. By setting the opaque property you are guaranteeing that the component will paint its own background in an opaque color.
For example a JPanel is opaque and its paintComponent() method will invoke the fillRect(...) method to paint the background whatever color is specified by the setBackground() method.
So if you do panel.setBackground(Color,RED) this is valid.
However, if you do panel.setBackground( new Color(255, 0, 0, 128) ); this is invalid because you have set a background with an alpha value that results in a transparent color. In this case you will generally see artifacts in the background of the panel. If you want to do this, then you must also use setOpaque(false), so that the background of the ancestor component is painted first.
Edited by: camickr on Jul 8, 2008 11:18 AM
Fixed an incorrect reference from "non-opaque" to "opaque".