Modifying AreaOfEffect

I’ve downloaded and successfully ran the VASSAL source code in Netbeans. I’m trying to add custom code and am not too concerned, at least at this point, in making it a module. I’ve created a Hexes class in package vassal.counters. Hexes does not extend or implement anything.(Hexes holds terrain information). In AreaOfEffect I’ve declared a two-dimensional array, Hexes hexes[][]; and instantiated it, hexes = new Hexes[33][11]. Stepping through the code using the debugger there’s no problem to this point. However, in AreaOfEffect, when I try to assign a String value to a String field (public String secTerrain) in hexes, e.g.
hexes[x][rownum].secTerrain = “slope”,I receive the VASSAL’s Uncaught Exception dialog. So I have a couple questions. Does Hexes need to extend/implement Abstract Configurable or Decorator or is there more likely a problem with my general Java coding? And two, is there some way to ‘disable’ the Uncaught Exception dialog box? I’m confused on why while stepping through the code in my IDE I get that dialog appearing instead of the IDE,first, jumping to the code that created that dialog?
Any help on this would be appreciated. I’ve been studying all the code for a long time and have been struggling with it.

Thus spake jl via messages:

I’ve downloaded and successfully ran the VASSAL source code in Netbeans.
I’m trying to add custom code and am not too concerned, at least at this
point, in making it a module. I’ve created a Hexes class in package
vassal.counters. Hexes does not extend or implement anything.(Hexes
holds terrain information). In AreaOfEffect I’ve declared a
two-dimensional array, Hexes hexes[][]; and instantiated it, hexes = new
Hexes[33][11]. Stepping through the code using the debugger there’s no
problem to this point. However, in AreaOfEffect, when I try to assign a
String value to a String field (public String secTerrain) in hexes, e.g.

hexes[x][rownum].secTerrain = “slope”,I receive the VASSAL’s Uncaught
Exception dialog. So I have a couple questions. Does Hexes need to
extend/implement Abstract Configurable or Decorator or is there more
likely a problem with my general Java coding?

We’d need to see your code to have an idea of that.

And two, is there some way
to ‘disable’ the Uncaught Exception dialog box?

Yes, but you absolutely should not do that. Uncaught exceptions are
bugs. The right thing to do is to fix the bug, not hide it.


J.

Thanks for the info. I figured what I was doing wrong. I assumed it was a Vassal-specific problem, but it was just a coding error on my part. I declared a:

two-dimensional array, Hexes hexes[][]; and instantiated it, hexes = new Hexes[33][11]. >>
but neglected to create/instantiate the individual elements. ie I needed to add the following code: hexes = new Hexes[33][0], hexes = new Hexes[33][1], etc, before java allows me to:
<< hexes[x][rownum].secTerrain = “slope” >>
I think the key is that my Hexes are full-fledged classes and not just primitives whereas,in the latter, one can simply assign (via =)
a value to an array element such as Hexes[1][2] =3

I believe my Uncaught exception issue needs more research on my part also.