public void calculate(double x)
 {
  if (lastCommand.equals("+"))
   result += x;
  else if (lastCommand.equals("-"))
   result -= x;
  else if (lastCommand.equals("*"))
   result *= x;
  else if (lastCommand.equals("/"))
   result /= x;
  else if (lastCommand.equals("="))
   result = x;
  display.setText("" + result);
  
 }