Hi, here is part of my code, after compilation, I get a Null Pointer Exception on the ORANGE part, I don't know where goes wrong.
for (int i = 0; i < N_BITS; i++){
ResultButton button = new ResultButton(0);
add(button, constraint);
resArr.add(button);
}
Note:
1. N_BITS is a just a constant.
2. resArr is an ArrayList, containing ResultButton, instance variable.
3. class ResultButton is defined by myself.
HELP ME TO FIGURE OUT THE PROBLEM, THANK YOU!