title: Can a for loop be used in a JOptionPane.showMessageDialog?
body: <p>So I'm new here, and this is my first question...Is there a proper syntax for using the for loop in JOptionPane.showMessageDialog?</p>
  
  <p>This is my current code and I know that it doesn't work. My code is for showing the factors of a certain integer and I want to know how can I show that in a JOptionPane.</p>
  
  <pre><code>String c = JOptionPane.showMessageDialog(null
  ,for(d=1;d&lt;=c;d++){
     if(c%d==0){
       d+" "
     }
   }  
  ,"The factors of "+c+" are: "
  ,JOptionPane.INFORMATION_MESSAGE);
  </code></pre>