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 inputA extends Thread implements ActionListener
{
	 Container c; 
	 String s=" ";
	 JTextArea jt;
	 JButton bb;
	 boolean basildi;
	 
	 public inputA()
	 {	 		 
	 jt=new JTextArea(s,5,30);
	 jt.setFont(new Font("SansSerif",Font.PLAIN,20)); 
	 bb=new JButton("push button after entering the function into to the window : x");
	 JScrollPane jsp=new JScrollPane(jt);
     JFrame cerceve=new JFrame("function input window example: Math.sin(x)-1/(x*x-1) ");
     cerceve.addWindowListener(new BasicWindowMonitor1());
     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 s;
	 }
	 	  
     protected void finalize() throws Throwable
     {super.finalize();}
     
public void actionPerformed( ActionEvent e)
{
  if(e.getSource()==bb)
  {s=jt.getText();
  basildi=true;
  try{finalize();} catch(Throwable e1) {System.err.println("girdi hatası.");} 
  }     
}
}