title: Display number of leap years between two years in a single dialog box
body: <p>I need a little help. I kind of want my output to show a tabled format of the leap years.</p>
  
  <p>But even though my program does work... it doesn't necessarily come up like the one in the picture. Can anyone show me how to work it?</p>
  
  <p>Here's my input:
  <strong>2000 - 2020</strong></p>
  
  <p>Here's my output (but in separate JOptionPane popup boxes):
  <strong>2000</strong>, <strong>2004</strong>, <strong>2008</strong>, <strong>2012</strong>, <strong>2016</strong></p>
  
  <p>Here's my code:</p>
  
  <pre><code>    String enterYear = JOptionPane.showInputDialog(null, "Enter the starting year: \nExample: 2015");   // User enters an input (Year)
      String enterLastYear = JOptionPane.showInputDialog(null, "Enter the ending year: ");
      int i = Integer.parseInt(enterYear);
      int x = Integer.parseInt(enterLastYear);
      String output = "";
  
      if (i &lt; x){
          for (i = Integer.parseInt(enterYear); i &lt; x; i ++ ){
              if(i % 4 == 0 &amp;&amp; i % 100 != 0 || i % 400 == 0) {
  
                  JOptionPane.showMessageDialog(null, i + "");
              }
          }
      } else {
          JOptionPane.showMessageDialog(null, "Error: Starting Year is greater than Ending Year!");
      }
    }
  }
  </code></pre>