I'm developing a swing applet which features a JPanel with a GridLayout.
The row and columns of the widgets placed into this layout are of significance to the widgets. Currently, I do not keep a reference to the widgets (though they're subclasses of Swing widgets, so they're readily modifiable).
At one stage, I need a widget in this grid to process its neighbouring widgets; that is, the widgets to its left, right, up and down in the GridLayout must be accessible by the widget.
Am I able to get references to these widgets from the GridLayout by knowing their row and column number in the layout? Is there a relevant GridLayout method?
(I believe the Qt GUI framework had a method for this)
Otherwise, I suppose I'll have to keep references to the widgets in an array.
Thanks