title: Java Factorial On JOptionPane
body: <p>I want to show factorial result and work(calculation) in same <code>JOptionPane</code> dialog box, as example <code>1x2x3x4x5=120</code> and spent hours but haven't found a solution. Any help will be highly appreciated. :)</p>
  
  <pre><code>private fun uploadWithTransferUtility(remote: String, local: File) {
     String number = JOptionPane.showInputDialog("Please enter the number below ");
  
     int n = Integer.parseInt(number);
     long fact = 1;
      int i = 1;
      if (n&lt;=0){
      JOptionPane.showMessageDialog(null," Please enter a possitive number");
  
      }
      else{
  
       while(i&lt;=n)
      {
  
  
      if (i==1){
              fact = fact * i;
              System.out.print(i);
              i++;
          }
          else{
              fact = fact * i;
              System.out.print("*"+i);
              i++;
      }
  
  
      JOptionPane.showMessageDialog(null,"="+fact);   
  }
  </code></pre>