Handlers
import java.awt.*;
import java.awt.event.ActionListener;
public class FunctionPanel extends KeyPanel {
public FunctionPanel(Calculator calculator) {
super(calculator);
ActionListener handler = getOperationHandler();
//GridLayout(rows, columns, hgap, vgap)
setLayout(new GridLayout(2, 3, 5, 10));
addKey("C", "Clear", handler);
addKey("SQR", "Square", handler);
addKey("SQRT", "SquareRoot", handler);
addKey("1/X", "Inverse", handler);
addKey("MR", "MemoryRecall", handler);
addKey("MC", "MemoryClear", handler);
addKey("M-", "MemoryMinus", handler);
addKey("M+", "MemoryPlus", handler);
}
}
This program works perfect. What I was wondering if anyone could help me with is the line
ActionListener handler = getOperationHandler();
Does anyone know what this keyword means. I mean I know what an actionListener is but I don't understand the getOperationHandler(), keyword, how does this handle all of the operations.

