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

class gm extends AbstractTableModel implements TableModelListener
{  private static final long serialVersionUID = 7432664L;
  Object[][] veri;
  String[] baslik;
  public gm(double[][] verij)
    { int n=verij.length;
    int m=verij[0].length;
    Double verii[][]=new Double[n][m];
    for(int i=0;i<n;i++)
    {for(int j=0;j<m;j++)
      {verii[i][j]=new Double(verij[i][j]);}
    }
	veri=verii;
    String b[]=new String[m];
    for(int i=0;i<m;i++) {b[i]="x["+i+"]";}
    baslik=b;
  }
  public gm(Object[][] verii)
  { 
    int n=verii.length;
    int m=verii[0].length;
    String b[]=new String[n];
    for(int i=0;i<m;i++) {b[i]="x["+i+"]";}
    baslik=b;
    veri=new Object[n][m];
    baslik=new String[m];
    for(int j=0;j<m;j++)
    {for(int i=0;i<n;i++)
       {veri[i][j]=verii[i][j];}
    }
    addTableModelListener(this);
  }
  
  public gm(Object[][] verii,String basliki[])
  {
    int n=verii.length;
    int m=verii[0].length;
    veri=new Object[n][m];
    baslik=new String[m];
    for(int j=0;j<m;j++)
    {for(int i=0;i<n;i++)
       {veri[i][j]=verii[i][j];}
       baslik[j]=basliki[j];
    }
    addTableModelListener(this);
  }
 
  public int getRowCount() {return veri.length;}
  
  public int getColumnCount() {return baslik.length;}
  
  public Object getValueAt(int satir,int sutun) {return veri[satir][sutun];}
  
  public String getColumnName(int c) {return baslik[c];}
  
  public void setValueAt(Object val, int row, int col)
  {veri[row][col] = val;}
  
  
  public void tableChanged(TableModelEvent e)
  {   } 
   
  public void setValues(Object[][] verii,String basliki[])
  { veri=verii;
    baslik=basliki;
  }
  public void setValues(double[][] verij)
  { int n=verij.length;
    int m=verij[0].length;
    Double verii[][]=new Double[n][m];
    for(int i=0;i<n;i++)
    {for(int j=0;j<m;j++)
      {verii[i][j]=new Double(verij[i][j]);}
    }
	veri=verii;
    String b[]=new String[m];
    for(int i=0;i<m;i++) {b[i]="x["+i+"]";}
    baslik=b;
  }
  
  public void setValues(Object[][] verii)
  { veri=verii;
    int n=verii[0].length;
    String b[]=new String[n];
    for(int i=0;i<n;i++) {b[i]="x["+i+"]";}
    baslik=b;
  }
  
  public Object[][] getValues(){return veri;}
  
  public boolean isCellEditable(int row, int col) {return true;}
}
