Good feedback by user27517. I want to add one thing, which is to use SwingUtilities.invokeLater()
in the main method:
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
new Calculator();
}
});
}