title: Java custom component
body: <p>I am trying  to develop a small 2d game in java. All objects in my code extend Rectangle in order to avoid re-writing geometry code about intersections, moving etc. My next issue is drawing all my objects. At the moment I designed a Renderer class that clears the background and redraws all the objects. On the other side, I observed that this is done automatically for java Components that are added to a panel (once a component is added, whenever I modify it's position the component is updating by its own).
  My next thought was to extend my object class with Component, but I can't do that, because I already extended it with Rectangle.
  How should I work this around?</p>
  
  <p>I hope I made myself clear enough :) </p>