title: creating a multiplication table using JOptionPane
body: <p>I have an assignment due tomorrow, I finished it, I just keep getting one error. Well its not exactly an error as much as it is my output is not the output my teacher wants. </p>
  
  <p>My teacher wants me to create a multiplication table using <code>JOptionPane</code> </p>
  
  <p>And this is what I have so far:</p>
  
  <pre><code>import javax.swing.JOptionPane;
  
  public class assign3 {
  
  public static void main(String[] args) {
  
          String Boundary1 = JOptionPane.showInputDialog(null, "Please enter the first boundary of the multiplication table.");
          String Boundary2 = JOptionPane.showInputDialog(null, "Please enter the second boundary of the multiplication table.");
  
          int X = Integer.parseInt(Boundary1);
          int Y = Integer.parseInt(Boundary2);
          int j = 1;
          String Result = "";
          int x = 1;
  
          while (x &lt;= X){
              for(int i = 1;i&lt;= Y; i++ ){
                  j = i * x;
                  Result = Result + j + "    ";
              }
              x++;
              Result = Result + "\n";
          }
          JOptionPane.showMessageDialog(null, Result);
      }
  }
  </code></pre>
  
  <p>My output shows up like this.</p>
  
  <p><a href="https://www.dropbox.com/s/ulp1gj9sqi94d3a/IMG_20140114_162054.jpg" rel="nofollow">https://www.dropbox.com/s/ulp1gj9sqi94d3a/IMG_20140114_162054.jpg</a></p>
  
  <p>But my teacher wants the output to show up like this.</p>
  
  <p><a href="https://www.dropbox.com/s/6gtexqoj3rs7xvl/IMG-20140114-WA0000.jpg" rel="nofollow">https://www.dropbox.com/s/6gtexqoj3rs7xvl/IMG-20140114-WA0000.jpg</a></p>
  
  <p>My code does not have the correct spacing between the digits, I have been trying to fix it somehow for sometime with no luck.</p>