title: Adding a JLabel in relative position to buttons
body: <p>OK, this is the relative code I have so far.</p>
  
  <pre><code>  for (int i = gameLines - 1; i &gt; 0; i--)
    {
       for (int j = 0; j &lt; i; j++)
       {
          JButton jButton = new JButton();
          jButton.setSize(buttonWidth, buttonHeight);
          jButton.setText("" + line[i].charAt(j));
          int x = ((buttonWidth / 2 * gameLines + 1) - (buttonWidth / 2 * i) + (buttonWidth * j));
          int y = (gameLines - (i + 1)) * buttonHeight;
          jButton.setLocation(x, y);
          panel.add(jButton);
          button[i][j] = jButton;
          button[i][j].setActionCommand(Integer.toString(i) + "." + Integer.toString(j));
          button[i][j].addActionListener(this);
       }
    }
  </code></pre>
  
  <p>The code creates and places all my buttons where I want them to be.  This took me a while to figure out.  I'm originally an AppleSoft BASIC programmer, I'm sorry about the i &amp; j variable names.</p>
  
  <p>Now for the fun.  To the right of the bottom 3 rows of buttons, I want to place a jLabel.  The right edge of the jLabel is to align with the right edge of the rightmost button in the top row.  The text in each will be right justified, ending with a : and an up-to 4 digit number.</p>
  
  <p>I'm thinking I can simply calculate the position like I did the button positions.  The text, I was going to add based on a switch/case.</p>
  
  <p>I'm having an trouble understanding JLabels, so I'd appreciate ANY help I can get.</p>
  
  <p>My current thoughts are: to be inserted after the j loop</p>
  
  <pre><code>if (i &lt; 4)
  {
      JLabel jLable = new JLabel();
      JLabel.setSize(???, buttonHeight);
      Calculate value of X;
      int y = (gameLines - (i +1)) * buttonHeight;
      jLabel.setLocation(x,y);
      switch (i)
      {
         case 3:
            jLabel.setText("Buttons Clicked: " + buttonsClicked);
            break;
         case 2:
            etc.
      }
      panel.add(jLabel);
  }
  </code></pre>
  
  <p>HELP please</p>