Ejemplo n.º 1
0
  /** Method in JComponent overrided to draw this MazeGrid */
  public void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;

    // draw each cell in the grid using drawCell()
    Cell a = new Cell(0, 0);
    for (; a.row < grid.getRows(); a.row++) {
      for (; a.col < grid.getCols(); a.col++) {
        drawCell(g2, a);
      }
      a.col = 0;
    }
  }
Ejemplo n.º 2
0
 /**
  * Method in JComponent overrided to set the minimum size of window space that this component gets
  */
 public Dimension getMinSize() {
   return new Dimension(grid.getCols() * cellWidth, grid.getRows() * cellWidth);
 }