title: How can I make a list of line functions into one drawPolygon function with JPanel?
body: <p>Is there any way I can put this into a simple draw/fillPolygon? I'm trying to draw something which would be much easier and much less redundant with the use of a polygon function but I'm not sure how to use it with <code>JPanel</code>.</p>
  
  <pre><code>g2D.draw(new Line2D.Double(0, 4, 3,4));
  g2D.draw(new Line2D.Double(3, 4, 5,3));
  g2D.draw(new Line2D.Double(5, 3, 12,3));
  g2D.draw(new Line2D.Double(12, 3, 11,2));
  g2D.draw(new Line2D.Double(11, 2, 9,1));
  g2D.draw(new Line2D.Double(9, 1, 3,1));
  g2D.draw(new Line2D.Double(3, 1, 0,2));
  g2D.draw(new Line2D.Double(0,2,0,3));
  g2D.draw(new Line2D.Double(0, 3, 0,4));
  </code></pre>