title: Java Swing Multiinput Second JTextField on the second row
body: <p>i am not really familiar with JPanel and kinda stuck at one thing.
  I want to know how to make second JTextfield on the second row.
  They appear to be on the same row.</p>
  
  <pre><code>import javax.swing.*;
  
  public class JOptionPaneMultiInput {
     public static void main(String[] args) {
        JTextField xField = new JTextField(5);
        JTextField yField = new JTextField(5);
  
        JPanel myPanel = new JPanel();
        myPanel.add(new JLabel("x:"));
        myPanel.add(xField);
        myPanel.add(new JLabel("y:"));
        myPanel.add(yField);
  
        int result = JOptionPane.showConfirmDialog(null, myPanel, 
             "Please Enter X and Y Values", JOptionPane.OK_CANCEL_OPTION);
        }
     }
  </code></pre>