g2.setColor(Color.green);
    g2.draw(theInsideBox);//theInsideBox is green
    g2.setColor(Color.blue);
    g2.draw(theIntersectingBox);//blue
    g2.setColor(Color.magenta);
    g2.draw(theOutsideBox);//magenta 


Figure 9