how to fill and show an array with graphic components?
I'm trying to program tetris, as I don't have that much experience I'm thinking of starting primitively.
My Idea is a board(which is an array) filled with blanks and figure square(for the time being, there is only one figure square which contains of 1 block of 50x50) put in a loop refreshing the y coord of the figure square +1.
I want to fill a 2d array with this BlankSquareComponent(which is just a grey filled 50x50 rectangle I made.
Now I know how to make a array board using empty spaces with the String class but I'm quite lost on how to do this. Is this possible and how should I do this?
Thanks in advance
here is the code so far...
public class TetrisBoard extends JComponent
private BlankSquareComponent  board;
private BlankSquareComponent BlankSquareComponent;
private static final int ROWS = 15;
private static final int COLUMNS = 5;
board = new BlankSquareComponent[ROWS][COLUMNS];
for (int i = 0; i < ROWS; i++ )
for(int j = 0; j < COLUMNS; j++)
board[i][j] = BlankSquareComponent;
//I should have a paintComponent, but no idea what to do with it :/