title: How insert or delete row of JPanel consisting of 3 elements
body: <p>I am using JPanel of three elements row: JLabel, JTextField, JButton.</p>
  
  <pre><code>jPanel.setLayout(new GridLayout(0,3));
  </code></pre>
  
  <p>I need button of a row to delete its row from JPanel.</p>
  
  <pre><code>    for(Pair&lt;JLabel, JTextField&gt; pair: labelTextFieldPairs) {
          jPanel.add(pair.getFirst());
          jPanel.add(pair.getSecond());
          jPanel.add(createDeleteButton());//how to implement that method?
      }
  </code></pre>
  
  <p>Also I have a button to add row to JPanel.</p>
  
  <p>How to do that? Or is it better to use JTable for that?</p>
  
  <p>What if I need to insert row consisting of 3 elements somewhere in the middle of JPanel. How to do that?</p>
  
  <pre><code>    JButton addNumberToListButton = new JButton("add number to list");
      addNumberToListButton.addActionListener(new ActionListener() {          
          @Override
          public void actionPerformed(ActionEvent e) {
              Pair&lt;JLabel, JTextField&gt; pair = new Pair&lt;&gt;(new JLabel(), new JTextField());
              labelTextFieldPairs.add(pair);
  
              jPanel.add(pair.getFirst(), labelTextFieldPairs.size()); 
              jPanel.add(pair.getSecond(), labelTextFieldPairs.size());
              jPanel.add(createDeleteButton(), labelTextFieldPairs.size());
  //will this 3 lines work?
          }
      });
  </code></pre>