
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Opgave11_4 extends JFrame implements ActionListener {

    private JButton add, clear;
    private JTextField entry, sum;

    public static void main(String[] args) {
        Opgave11_4 frame = new Opgave11_4();
        frame.setSize(200,150);
        frame.createGUI();
        frame.show();
    }

    private void createGUI() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container window = getContentPane();
        window.setLayout(new FlowLayout() );

        entry = new JTextField("123", 10);
        window.add(entry);

        add = new JButton("add");
        window.add(add);
        add.addActionListener(this);

        sum = new JTextField("0", 10);
        window.add(sum);

        clear = new JButton("clear");
        window.add(clear );
        clear .addActionListener(this);

    }

    public void actionPerformed(ActionEvent event) {
       //vul hier de code aan
    }
}

