title: Java Dynamic Matrix
body: <p>OK so the title tells little, but I am looking to make an editor of sorts for mazes. I had an assignment to make a maze solver. I did this by reading a file. The first line has the row and column count. After that it is a maze of symbols to make the maze. I ran through each place and depending on the symbol made a matrix with a number representing what was there. </p>
  
  <pre><code>For Instance:
  
  11 25
  *************************
  *  ***                 **
  **   * ***** *****   ****
  ** ***  **********   ****
  ** ****      *       ****
  **     ***** *****     **
  ** *** ***** ********* **
  ** *** ***** ********* **
  **  ** ***** ********* **
  *  ***         ***     **
  *****************   *****
  
  1111111111111111111111111
  1001110000000000000000011
  1100010111110111110001111
  1101110011111111110001111
  1101111000000100000001111
  1100000111110111110000011
  1101110111110111111111011
  1101110111110111111111011
  1100110111110111111111011
  1001110000000001110000011
  1111111111111111100011111
  </code></pre>
  
  <p>That is my matrix that comes out. Now I have this solving this, so that isn't an issue. But I want it so I can ask the row count and column count, draw a rectangle that size, make a matrix [row][column] big with all 0's, that fits in the screen, grid it based on the matrix and then when they click the box that is for matrix[0][0] it changes that to a 1 and so one for each grid box that represents a spot in the matrix. </p>
  
  <p>That way I can allow them to make a maze and then have the program solve it, or they can save it. </p>
  
  <p>Of course this is where I am having issues, how do I draw a rectangle that has a grid based on the count of rows and columns then make it so I know where they clicked......</p>
  
  <p>Any help would be great.</p>
  
  <p>EDIT: OK I have it drawing the maze based on rows and columns given. I have it detecting the click and it can put on square where I click. But it isn't changing the overall matrix and then redraw the whole thing again. </p>