Design a simple calculator (called SwingCalculator).
Hints:
Set the ContentPane to BorderLayout. Add a JTextField (tfDisplay) to the NORHT. Add a JPanelw (panelButtons) to the CENTER. Set the JPanel to Grid Layout of 4×4, and add the 16 buttons.
Operator buttons “+”, “-“, “*”, “/”, “%” and “=”.
1 Answer