title: How to set specific window (frame) size in java swing?
body: <p>My code does not work:</p>
  
  <pre><code>JFrame frame = new JFrame("mull");
  
  mull panel = new mull();
  
  // add panel to the center of window
  frame.getContentPane().add("Center", panel);
  frame.setSize(500, 300); // &lt;&lt; not working!!!
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.pack(); // give a suitable size to window automatically
  frame.setVisible(true); // make window visible
  </code></pre>
  
  <p>I am getting very small window. How to fix it?</p>