Good feedback by user27517. I want to add one thing, which is to use [`SwingUtilities.invokeLater()`][1] in the main method: public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new Calculator(); } }); } [Why it's needed][2] [1]: http://docs.oracle.com/javase/7/docs/api/javax/swing/SwingUtilities.html#invokeLater%28java.lang.Runnable%29 [2]: http://stackoverflow.com/questions/3551542/swingutilities-invokelater-why-is-it-neded