title: How to make an input dialogbox which has more than one textfield(ie. can take many inputs)
body: <p>I have implemented an <strong>input</strong> DialogBox, however this has <strong>one textfield</strong>. I need an input DialogBox which has <strong>many textfields</strong> to take input from and store each String in an array.</p>
  <p>What I have done so far:</p>
  <p><a href="https://i.stack.imgur.com/o59AT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o59AT.jpg" alt="alt text" /></a></p>
  
  <hr />
  <h2>CODE</h2>
  <pre><code>import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JOptionPane;
  import javax.swing.JTextField;
  
  public class second extends JFrame implements ActionListener {
  
  JLabel enterName;
  JTextField name;
  JButton click;
  String storeName;
  
  public second() {
  
      setLayout(null);
      setSize(300, 250);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      click = new JButton(&quot;Click&quot;);
      click.setBounds(100, 190, 60, 30);
      click.addActionListener(this);
      add(click);
  }
  
  public void actionPerformed(ActionEvent e) {
  
      if (e.getSource() == click) {
      String response = JOptionPane.showInputDialog(null,
                  &quot;What is your name?&quot;,
                  &quot;Enter your name&quot;,
                  JOptionPane.QUESTION_MESSAGE);
      }
      }
  
      public static void main(String args[]) {
  
      second s = new second();
      s.setVisible(true);
  }
  }
  </code></pre>
  <hr />
  <p>Many Thanks</p>