title: Using a string containing variables in JOptionPane
body: <p>I am trying to build a string using "if" statements, and then using the built string to show in a JOptionPane.</p>
  
  <pre><code>//If the value is zero, don't show the line item
   if (intLays &gt; 0)
   strBuiltOrder = "intSnickers + \"Snickers\" + \"\\n\"";
  </code></pre>
  
  <p>In the end there would be one line item for each variable that had a value greater than zero. However, the problem is, when I use it in JOptionPane, it outputs the literal.</p>
  
  <pre><code>intSnickers + \"Snickers\" + \"\\n\"
  </code></pre>
  
  <p>Is there anyway I can build a string to insert into JOptionPane, or is there another way to withhold variables from the JOptionPane if their value is zero?</p>