 <p>You are making a psudo constructor for placing <code>void</code> before <code>GridBagTest()</code> which specifies that <code>GridBagTest()</code> is a function not a constructor. So call:</p> <pre><code>new GridBagTest().GridBagTest(); </code></pre> <p>inside the main function. Which obviously you should not do: rather remove the return type <code>void</code>:</p> <pre><code>public GridBagTest(){ //&lt;--- void is removed JFrame gameFrame = new JFrame("FightQuest"); // other code } </code></pre> <p>However, always start your program from the EDT by submitting it to EventQueue using <code>SwingUtilities.invokeLater(Runnable)</code>:</p> <pre><code>SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new GridBagTest(); } }); </code></pre>