The problem is not uncommon on this site. I've written on this before, but I must say:
this version is very complex and subtle.
First of all: Main extends JPanel, but nevertheless in the 'initG' method another
Main panel is created. However, this panel is not subject to 'initG' and 'init',
so Ant ant gets uninitialized.
The extra complication is that in 'main' all looks okay. a new Main g is created,
and that g is neatly subjected to initG and init. But that is not the panel
that gets added to the frame....
Here is a corrected listing that works. Since I do not have the Cell and Ant classes,
I dropped the Cell and turned Ant into a String. I tried not to change too much,
but OP's construct and mine are still ehh... not 'top notch'.
There are three kinds of actuaries: those who can count, and those who can't.