You can't access it outside the constructor, because presumably it's private
. You can only access it in the constructor because it's an argument to the constructor.
You can either:
- Make the proper variable
protected
in the superclass to make it visible to the subclass, OR - (Kind of kludgy) Create your own variable in your subclass to store its own reference to the
GridPanel
, so you can access it in other methods.