title: ArrayList and JOptionPane.showInputDialog()
body: <p>I am trying to learn Java and have come a long way from PHP, I tried to apply the same mentality when creating my code. But as many of you have already known, it doesn't work that easily.</p>
  
  <p>So with that said, I have a question. I want to create a drop down list from items in an <code>ArrayList</code>. I am fond of the idea of using the <code>JOptionPane.showInputDialog()</code> method to attempt this.</p>
  
  <p>This is what I have currently, but I get an error telling me that <code>no suitable method found for showInputDialog</code></p>
  
  <pre><code>ArrayList&lt;String&gt; projectList = new ArrayList&lt;String&gt;();
  
  while(results.next())
      projectList.add(results.getString("project"));
  
  String inputDialog = (String)JOptionPane.showInputDialog(this, "Choose project to open", "Open Project", JOptionPane.PLAIN_MESSAGE, null, projectList, "--");
  </code></pre>
  
  <p>I know that the issue is that when I pass the <code>ArrayList</code> as the array object I get thrown this error. But if I did something like</p>
  
  <pre><code>Object[] projectList = {"one", "two"};
  </code></pre>
  
  <p>then it works as intended, I then tried to maybe do this and pass in <code>projects</code> as my array object.</p>
  
  <pre><code>Object[] projects = {projectList.toString()};
  </code></pre>
  
  <p>This somewhat works, but then the output looked like <code>"one, two"</code> in drop down list as 1 line item.</p>