numPanel.setLayout(new GridLayout(4,3,5,5));
add(calculatorDisplay);
numPanel.add(one);
numPanel.add(two);
numPanel.add(three);
numPanel.add(four);
numPanel.add(five);
numPanel.add(six);
numPanel.add(seven);
numPanel.add(eight);
numPanel.add(nine);
numPanel.add(zero);
opsPanel.setLayout(new GridLayout(2,4, 5, 5));
opsPanel.add(plus);
opsPanel.add(minus);
opsPanel.add(times);
opsPanel.add(divide);
opsPanel.add(equals);
add(numPanel);
add(opsPanel);
add(clear);
one.addActionListener(this);
two.addActionListener(this);
three.addActionListener(this);
four.addActionListener(this);
five.addActionListener(this);
six.addActionListener(this);
seven.addActionListener(this);
eight.addActionListener(this);
nine.addActionListener(this);
zero.addActionListener(this);
clear.addActionListener(this);
plus.addActionListener(this);
minus.addActionListener(this);
times.addActionListener(this);
divide.addActionListener(this);
equals.addActionListener(this);
arrPanel.setLayout(new GridLayout(4,3,5,5));
for (int index = 0; index < 10; index++)
{
butArray[index] = new Button(Integer.toString(index));
arrPanel.add(butArray[index]);
butArray[index].addActionListener(this);
}
add(arrPanel);
currentValue = 0;