title: Use of overriding getPreferredSize() instead of using setPreferredSize() for fixed size Components
body: <p>I read some posts here and I started why some people do</p>
  
  <pre><code>@Override
  public Dimension getPreferredSize() {
      return new Dimension(500, 500);
  }
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>setPreferredSize(new Dimension(500, 500));
  </code></pre>
  
  <p>Isn't the second one better because it creates only one <code>Dimension</code> object whereas the first one possibly creates several (even if it's not that much wasted memory)? Or am I wrong? Is there a difference at all?</p>