
import java.awt.*;
import javax.swing.*;

public class Add extends JFrame {

    public Add() {
        // buttons for 0 to 9 and button start , stop   panal
        JPanel p1 = new JPanel();
        p1.setLayout(new GridLayout(3, 3));
        for (int i = 0; i <= 9; i++) {
            JButton jb = new JButton("" + i);
            p1.add(jb);
        }
        JButton jb1 = new JButton("0");
        p1.add(jb1);

        JButton jb2 = new JButton("Start");
        p1.add(jb2);

        JButton jb3 = new JButton("Stop");
        p1.add(jb3);
        // button and textfield panal
        JPanel p2 = new JPanel(new BorderLayout());
        JTextField txt = new JTextField(" time to be displayed");
        p2.add(txt, BorderLayout.EAST);

        JButton j = new JButton("food to be placed here");
        p2.add(j, BorderLayout.WEST);
        // container panal
        JPanel p3 = new JPanel();
        p3.add(p1);
        p3.add(p2);
        this.add(p3);
    }

    public static void main(String args[]) {
//        JFrame frame = new JFrame();
//        frame.setVisible(true);
//        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        frame.setSize(500, 500);
//        frame.setLocationRelativeTo(null);
//        frame.setTitle("Amal");
        Add add = new Add();
        add.setVisible(true);
        add.setDefaultCloseOperation(Add.EXIT_ON_CLOSE);
        add.setSize(330, 160);
        add.setLocationRelativeTo(null);
        add.setTitle("Amal");
    }
}
     