private JFrame f = new JFrame("Simple Calculator"); private JLabel num1 = new JLabel("Number1"); private JLabel num2 = new JLabel("Number2"); private JTextField input1 = new JTextField(); private JTextField input2 = new JTextField(); private JLabel sum = new JLabel("Sum"); private JTextField sumText = new JTextField();
public SimpleCalculator() {
sumText.setEditable(false);
input1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (input2.getText() == null || input2.getText().trim().equals("")) { return; }