import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.io.*;
import java.util.*;


public class girdi2_t extends Thread implements ActionListener
{
	 Container c; 
	 String s=" ";
	 String s1="";
	 functiongenerator_t fg;
	 JTextArea jt;
	 JButton bb;
	 boolean basildi;
	 
	 public girdi2_t(String isim,String fonksiyon)
	 {	 		 
	 jt=new JTextArea(s,5,30);
	 jt.setFont(new Font("SansSerif",Font.PLAIN,20));
	 fg=new functiongenerator_t();	 
	 bb=new JButton("fonksiyon yazıldığında basınız. değişken : x,t");
	 JScrollPane jsp=new JScrollPane(jt);
     JFrame cerceve=new JFrame("fonksiyon girdi penceresi örnek: Math.sin(x)-1/(x*x-1) ");
     cerceve.addWindowListener(new BasicWindowMonitor());
     c=cerceve.getContentPane();
     c.setLayout(new BorderLayout());
     c.add(jsp,BorderLayout.NORTH);
     c.add(bb,BorderLayout.SOUTH); 
     bb.addActionListener(this);         
     cerceve.pack();
     cerceve.setVisible(true);
     basildi=false;
     }     
     
     public String vericiktisi()
     {  
        while(!basildi)
        {
        try {Thread.sleep(100);} 
        catch(InterruptedException e)  {System.err.println(e.toString());}
        } 
	    return s1;
	 }
	 	  
     protected void finalize() throws Throwable
     {super.finalize();}
     
public void actionPerformed( ActionEvent e)
{
  if(e.getSource()==bb)
  {s=jt.getText();fg.addfunction(s);s1=fg.createfunction();
  basildi=true;
  try{fg.finalize();finalize();
    } catch(Throwable e1) {System.err.println("girdi hatası.");} 
  }     
}
}