Experiments in Java

Notes on Session G1: Graphics and Applets

Experiment G1.3, Step 1. Since Java draws both circles in exactly the same place, we might expect one of two things to happen: (1) the two colors could blend, yielding a third color or (2) the second color could obscure the underlying color. By default, Java uses opaque paints, so the second option occurs. That is, only the second circle is visible.

Experiment G1.3, Step 2. Although intuition would suggest that the first circle (red, in our example) would not appear, the differences between drawing and filling lead to a situation in which small pieces of blue should be visible.

Copyright (c) 1998 Samuel A. Rebelsky. All rights reserved.

Source text last modified Wed Sep 22 20:56:48 1999.

This page generated on Wed Sep 22 20:57:17 1999 by Siteweaver.

Contact our webmaster at rebelsky@math.grin.edu