import java.awt.*;

class ShowOutput extends Frame {
   private TextArea notesArea = null;
   private Button b;

   public ShowOutput() {
       setLayout(new BorderLayout(3,3));
       setTitle(" Siparis ");
       setSize(200,300);
       move(300,100);
       notesArea = new TextArea(10, 30);
       notesArea.setEditable(false);
       add("Center", notesArea);
       b=new Button("Cikis");
       add("South", b);
   }

   public void addText(double mP, double tP){
      notesArea.appendText("\nToplam Ucret : "+ mP + "\n");

   }

   public boolean handleEvent(Event olay) {
       switch (olay.id) {
           case Event.ACTION_EVENT:
                 if (olay.arg.equals("Cikis")) {hide();} break;
           case Event.WINDOW_DESTROY:{dispose(); break;}
           default: return false;
        }
        return true;
   }
}

class LoanMain extends Frame {

   ShowOutput sO= new ShowOutput();
   Loans l= new Loans();
   Button b1,b2;

   public LoanMain() {
       setLayout(new BorderLayout(3,3));
       setTitle(" Pizza Siparisi ");

       setSize(300,500);
       Panel p=new Panel();
       p.add(b1=new Button("Yeni Siparis"));
       p.add(b2=new Button("En son siparis"));
       add("South", p);

       show();
   }

   public boolean handleEvent(Event olay) {
       switch (olay.id) {
           case Event.ACTION_EVENT:
                 if (olay.arg.equals("Yeni Siparis")) {
                    l.show();
                 }
                 else if (olay.arg.equals("En son siparis")) {
                     sO.show();

                 }
                 break;
           case Event.WINDOW_DESTROY:
                 dispose();
                 break;
           default: return false;
        }
        return true;
   }
}

class Loans extends Frame {
    private TextField AdField,TelField,SemtField;
    private Label AdLabel,TelLabel,SemtLabel;
    private Button b1,b2;
    private List l,malzeme ;


    private Choice boyutu,hamur ;



    public String   Ad,Tel,Semt;

    public Loans() {
        initGUI();
    }

    private void initGUI() {
       setTitle(" Yeni Sipariş ");
       Panel iP=new Panel();
       iP.setLayout(new GridLayout(5,2));
       iP.add(AdLabel=new Label("Müsteri Adi:"));
       iP.add(AdField=new TextField(10));
       iP.add(TelLabel=new Label("Telefon No:"));
       iP.add(TelField=new TextField(10));
       iP.add(SemtLabel=new Label("Semt"));
       iP.add(SemtField=new TextField(10));

       boyutu = new Choice();
       boyutu.add("Kucuk");
       boyutu.add("Orta");
       boyutu.add("Buyuk");
       iP.add(boyutu);

       hamur = new Choice();
       hamur.add("Ince");
       hamur.add("Kalin");
       iP.add(hamur);

       iP.add(malzeme=new List(6,true));
       malzeme.add("SALAM  - 2 M TL") ;
       malzeme.add("MANTAR - 1 M TL") ;
       malzeme.add("SOSIS  - 3 M TL") ;
       malzeme.add("PEYNIR - 1 M TL") ;
       malzeme.add("ZEYTIN - 2 M TL") ;
       malzeme.add("ZEYTIN - 2 M TL") ;

       add("Center", iP);
       Panel BP= new Panel();
       BP.add(b1=new Button("Siparisi ver"));
       BP.add(b2=new Button("Cikis"));
       add("South",BP);
       pack();
    }


    public boolean action(Event evt, Object arg){
      if (evt.target.equals(b1)) {
        Ad =AdField.getText();
        Tel =TelField.getText();
        Semt = SemtField.getText();
        compute();
        AdField.setText("");
        TelField.setText("");
        SemtField.setText("");
        return true;
      }
      else if (evt.target.equals(b2)) {hide(); return true;}
           else return false;
    }

    public void compute(){
      
    }
}






class PizzaSipari
{
   public static void main (String args[])
   {
     LoanMain l= new LoanMain();
   }
}
