I have a form on which 300 textfield and a button
`public static int i,j,k,l,m,n,z,f; public static JLabel[] lbl = new JLabel[21]; public static JLabel[] lbl1 = new JLabel[16]; public static JTextField[][] tf1 = new JTextField[20][15]; public static int [][] qw = new int[20][15]; public static Random rand = new Random(); public static void main(String[] args) { JFrame fr1 = new JFrame("Массив"); JPanel pn1 = new JPanel(); fr1.setSize(600,400); fr1.setExtendedState(MAXIMIZED_BOTH); fr1.setDefaultCloseOperation(EXIT_ON_CLOSE); pn1.setLayout(null); fr1.add(pn1); //fr1.setContentPane(pn1); // for(i=0;i<20;i++){ for(j=0;j<15;j++){ tf1[i][j]=new JTextField(); tf1[i][j].setBounds(30+i*35,30+j*35,30,25); pn1.add(tf1[i][j]); } } for (k=1;k<21;k++){ lbl[k]=new JLabel(""+k); lbl[k].setBounds(10+k*35,5,30,20); pn1.add(lbl[k]); } for(l=1;l<16;l++){ lbl1[l] = new JLabel(""+l); lbl1[l].setBounds(5,5+l*35,30,20); pn1.add(lbl1[l]); } JButton btn1 = new JButton("Заполнить"); pn1.add(btn1); btn1.setBounds(856,250,100,50); JTextField tf3 = new JTextField(); pn1.add(tf3);tf3.setBounds(850,190,40,40); JTextField tf4 = new JTextField(); pn1.add(tf4); tf4.setBounds(910,190,40,40); btn1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { for (m = 0; m < 20; m++) { for (n = 0; n < 15; n++) { qw[m][n] = rand.nextInt(10) + 1; } } tf1[i][j].setText("" + qw[m][n]); } });` It turns out, when I click on the button to fill the array and textfield to the textfield , knocks an error, please ActionListner me what was wrong in the ActionListner I wrote? Thank you in advance!