title: Why is this wrong? Making 10 Components within 1 pane easily
body: <p>Before i begin, i have this whole pane being opened as an action. I was wondering why if I run this program, it doesn't output 10 lines of equations, with text areas to the right of them. It outputs a window, with nothing inside.
  (Program is being run in a different part of the code- this is a snippet.)</p>
  
  <p>`        </p>
  
  <pre><code>    pane2.setLayout(new GridBagLayout()); 
  
       GridBagConstraints d = new GridBagConstraints(); //Creates New GBC
  
       if (shouldFill) 
          {
              //natural height, maximum width
              d.fill = GridBagConstraints.HORIZONTAL;
          }
  
       if(multiTable &gt;= 1 &amp;&amp; multiTable &lt;= 12)
       {
           for(int r = 1; r &lt;= 10; r++)
           {
               int[] answer = {1};
               JPanel[] prob = new JPanel[10];
               JLabel[] probOutput = new JLabel[10];
               JTextArea[] uAnswer = new JTextArea[10];
  
               prob[r] = new JPanel();
               rand1 = random1.nextInt(12)+1;
               rand2 = random1.nextInt(2)+1;
               answer[r] = multiTable * rand1;
               if(rand2 == 1)
                  probType =( r+") "+multiTable+" x "+rand2);
               if(rand2 == 2)
                  probType =( r+") "+rand2+" x "+multiTable);
  
               probOutput[r] = new JLabel(probType);
               d.gridx = 0;
               d.gridy = r;
               pane2.add(probOutput[r], d);
               uAnswer[r] = new JTextArea();
               d.gridx = 1;
               d.gridy = r;
               pane2.add(uAnswer[r], d);
           }
           frame2.add(pane2);
           frame2.pack();
       }
   }`
  </code></pre>
  
  <p><a href="http://pastebin.com/NsqM7AZk" rel="nofollow">Here</a> is a link to a pastebin link for the full program (It's a school program I don't care for much, just need the grade.)</p>