title: How do display Multiple Lines in a JOptionPane with ArrayList
body: <p>I'm trying to display 2 Arraylist in the JOptionPane. But I get the following on the dialog box</p>
  
  <pre><code>1,2,3,4
  Swimming, Running, Cycling, Basketball
  </code></pre>
  
  <p>I would like to show the info in the dialog box like the following:</p>
  
  <pre><code>1 Swimming
  2 Running
  3 Cycling
  4 Basketball
  </code></pre>
  
  <p>Please advise how do I go about? Here are my codes.</p>
  
  <pre><code>import javax.swing.*;
  import java.util.ArrayList;
  
  public class gamelist {
      public static void main(String args[]){
  
          ArrayList&lt;String&gt; sku = new ArrayList&lt;String&gt; ();
          sku.add("1");
          sku.add("2");
          sku.add("3");
          sku.add("4");
  
  
          ArrayList&lt;String&gt; games = new ArrayList&lt;String&gt;();
          games.add("Swimming");
          games.add("Running");
          games.add("Cycling");
          games.add("Basketball");
  
          for(int i = 0; i&lt;games.size(); i++){
  
              String everything = sku.toString();
              String everything2 = games.toString();
  
              JOptionPane.showInputDialog(null, everything +"\n"+ everything2);       
          }
  
       }
  
  }
  </code></pre>