title: Complex shapes in Java Swing
body: <p>I have to create the structure of a bilding's floor in Java swing, something very similiar to
  <a href="https://i.stack.imgur.com/djLXd.png" rel="nofollow noreferrer">this</a> (without the writings). As you can see it's very simple, I don't need to add details, but there are certain requirements:</p>
  <ul>
  <li>The building must be shown in a JPanel where there will be other entities (pedestrians) that have to avoid collisions with its walls.</li>
  <li>It must be created according to the size of the JPanel, so its dimension can not be static.</li>
  </ul>
  <p>What is in your opinion the simplest/best class I can use to draw it (considering that I also have to check the collisions)? I'm not an expert, at first I thought I might use the class &quot;Area&quot; and build the shape of the building with rectangles, then each door using the &quot;subtract()&quot; method, removing a &quot;piece of wall&quot; intersecting it with another rectangle. Would it work?
  Thank you.</p>