title: JPanel help- Drawing rectangles
body: <p>I'm using Graphics for the first time but I have an issue where nothing is showing up besides the background (identified as Bcolor). I'm trying to make a grid with lines using fill(new Rectangle) method with color Lcolor. I ran the debugger, and there doesn't seem to be any syntax, run-time, or logic errors. Anyway to fix this? Thanks!</p>
  
  <pre><code>    public static void drawWindow(int Lcolor, int lineSize, int cellSize, int Bcolor){
      Graphics g = createWindow(cellSize, Bcolor, lineSize).getGraphics();
      Graphics2D g2d = (Graphics2D)g;
      for(int i = 0; i &lt;= (frameValues(cellSize, lineSize)[2]); i++){
          g2d.setColor(new Color(Lcolor, Lcolor, Lcolor));
          g2d.fill(new Rectangle(lineSize * i + cellSize * i, 0, lineSize, frameValues(cellSize, lineSize)[1]));
          //.drawLine(xpos,ypos,xsize,ysize)
      }//for loop
      for(int j = 0; j &lt; (frameValues(cellSize, lineSize)[3]); j++){
          g2d.setColor(new Color(Lcolor, Lcolor, Lcolor));
          g2d.fill(new Rectangle(0, lineSize * j + cellSize * j, frameValues(cellSize, lineSize)[0], lineSize));
      }//for loop
  
  }
  </code></pre>
  
  <p>and here is the createWindow() method:</p>
  
  <pre><code>public static JPanel createWindow(int cellSize, int Bcolor, int lineSize){
      JFrame frame = new JFrame("Evolution Of Life");
      frame.setSize(new Dimension(frameValues(cellSize, lineSize)[0], frameValues(cellSize, lineSize)[1]));
      frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      //making it visible
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
      //creating panel
      JPanel panel = new JPanel();
      frame.getContentPane().add(panel);
      panel.setBackground(new Color(Bcolor, Bcolor, Bcolor));
      return panel;
  }
  
  
  //If you need anymore information, I'll be happy to supply.
  </code></pre>