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 girdi extends Thread implements ActionListener
{
	 Container c; 
	 String s=" ";
	 JTextArea jt;
	 JButton bb;
	 boolean basildi;
	 double a[][];
	 int n,m;
	 
	 public girdi(int ni,int mi)
	 {
	 n=ni;
	 m=mi;	 
     a=new double[n][m];		 
	 jt=new JTextArea(s,20,20);
	 bb=new JButton("veri girişi tamamlandığında basınız");
	 JScrollPane jsp=new JScrollPane(jt);
     JFrame cerceve=new JFrame("Matris girdi penceresi ("+n+" * "+m+") matris giriniz");
     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 double[][] vericiktisi()
     {  
        while(!basildi)
        {
        try {Thread.sleep(100);} 
        catch(InterruptedException e)  {System.err.println(e.toString());}
        } 
	    return a;
	 }
	 
	  
     protected void finalize() throws Throwable
     {super.finalize();}
     
public void actionPerformed( ActionEvent e)
{
  if(e.getSource()==bb)
  {s=jt.getText();double b[][]=Text.readDoubleS(s,n,m);
  for(int i=0;i<n;i++){for(int j=0;j<m;j++){a[i][j]=b[i][j];};}
  basildi=true;
  }     
}
}