Create two overlapping rectangles and
fill in blue color in the intersection of two rectangles.

 
Hint:

  1. Create the first rectangle, box1, with top-left corner at (x, y) and width w, height h.
    You choose your own data for x, y, w, and h.
  2. Create the second rectangle, box2, with top-left corner at (x + w/2, y + h/2) and width h, height w.
  3. Call intersection method to store the intersection of box1 and box2 in box3.
    Rectangle box3 = box1.intersection(box2);

Provide a class IntersectionViewer and a class IntersectionComponent.

Send both java files to extrapo66@yahoo.com