I have a problem in this code.I can't display the array of Text Field.
import javax.swing.*; import java.awt.*; public class Projct extends JFrame { int x=3; public Projct(){ Container c=getContentPane(); c.setLayout(new BorderLayout()); JPanel p=new JPanel(); //new GridLayout(x,x) c.add(p,BorderLayout.CENTER); JTextField [][] array=new JTextField[x][x]; for(int i=0;i<x;i++){ for(int j=0;j<x;j++){ array[i][j].setText(" "); p.add(array[i][j]); } } int m=x; double [][] data=new double [m][m]; for(int i=0;i<m;i++){ for(int j=0;j<m;j++){ if (i == j) { data[i][j]=1; array[i][j].setText("1"); array[i][j].setEnabled(false); } else{ data[i][j]=Double.parseDouble(array[i][j].getText()); data[j][i]=(1/data[i][j]); }}} } public static void main(String[]arg){ Projct f=new Projct(); f.setTitle("AHP"); f.setVisible(true); f.setSize(500, 500); f.setLocation(40,60); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }