title: Java Swing resize BorderLayout.CENTER
body: <p>As the title says, can I redefine the height and width of Java's BorderLayout.CENTER? I plan to use Graphics2D to draw to this area but I won't always know ahead of time how big it should be to fit everything in.</p>
  
  <p>Draw class (declared inside my Main class):</p>
  
  <pre><code>@SuppressWarnings("serial")
  private class Draw extends JComponent {
      public void paint(Graphics graphics) {
          Graphics2D g = (Graphics2D) graphics;
          g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  
          Shape drawLine = new Line2D.Float(0, 0, 500, 500);
  
          g.setPaint(Color.BLACK);
          g.draw(drawLine);
      }
  }
  </code></pre>
  
  <p>Main constructor where Draw is called:</p>
  
  <pre><code>public Main() {
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setBounds(100, 100, 640, 480);
      setJMenuBar(getMenuBar_1());
      contentPane = new JPanel();
      contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
      setContentPane(contentPane);
      contentPane.setLayout(new BorderLayout(0, 0));
      contentPane.add(getPanelControls(), BorderLayout.SOUTH);
      contentPane.add(getPanelInfo(), BorderLayout.EAST);
      contentPane.add(new Draw(), BorderLayout.CENTER);
  }
  </code></pre>
  
  <p>I'm currently drawing directly to BorderLayout.CENTER. Should I be drawing to a JPanel and use it's setPreferredSize() method?</p>