Java homework - 12x12 grid
843785Oct 16 2008 — edited Oct 16 2008Hi,
I need to create a 12x12 grid inside a frame and color the grid field when the mouse has clicked on it. There are a lot of ways how to do it but neither of them has proved to be adequate. The plan was to create JPanel, set GridLayout 12x12 and add Rectangles as elements to the panel. Now, the panel.add(rectangle) method is now working and I don't know why, this is my second year of programming with Java.
I tried to search the forum, seeking for similar problem but so far nothing. I'd appreciate help in form of guidance how to approach to the problem.
Thanks.