title: Create JTextField dynamically in a loop
body: <p>I am beginner on Java GUI. I am writing a program that calculates the inverse of the given matrix. To do this, first i have to scan matrix. I decided to scan matrix by this way:</p>
  
  <p><img src="https://i.stack.imgur.com/QI2Ep.png" alt="enter image description here"></p>
  
  <p>First i am asking user the count of row or column of square matrix. When user enters a number and clicks <code>Tamam</code> button i want to create little NxN <code>JTextField</code> 's.</p>
  
  <p>So user will be able to enter each element of matrix easily. What i want to ask is this: I am unable to create NxN <code>JTextField</code>'s. My code:</p>
  
  <pre><code>private void jButtonRowCntMouseClicked(java.awt.event.MouseEvent evt) {                                           
          int i,j;
          if(jTextFieldRowCnt.getText() != null){
              String cnt = jTextFieldRowCnt.getText();
              Integer rowCnt = Integer.parseInt(cnt);                      
              for(i=0;i&lt;rowCnt;i++){
                  for(j=0;j&lt;rowCnt;j++){
                        JTextField textField = new JTextField();
                        this.add(textField);
                        pack();
                  }
              }
          }
      } 
  </code></pre>
  
  <p>But unfortunately, I could not make it.  Where am I going wrong?</p>
  
  <p>My another question is that, how can I set locations of NxN <code>JTextField</code>s?</p>