tags:

views:

42

answers:

1

I have a tower built from blocks like this :

alt text

Whole Tower is an array of Towers. Each Tower contains Box[] array containing single Box'es.What layout should I use for this and can you give me any tips on how to create it ?

Would it be easier if I would create Grid[][] containing Box'es? But I guess I can't store Box object inside Grid array. I'm just totally confused :/

+1  A: 

This may be a good time to clearly separate you view and model. Your model might have methods like nextMove(), getRow() and getRowCount(), while your view might consist of JTextField instances in a GridLayout for each row and multiple rows in a BoxLayout. The view asks the model about its current state; the model notifies the view when updates occur. This game was intended as a concrete example of the approach.

trashgod