Error in class
I have created a class for a GUI Frame. It has functions like add, delete, edit, etc. When I compile the class there are not syntax errors. But when I try to run the class, then there is an error that says :
this line of code from the class is highlighted:
Why is this and how do I correct it?
field[i] = new JTextField();
Let us know full code. :) and full error message which tells the line number.
NullPointerException happens when you try to use an object reference which is null. But it is impossible to say exact reason by looking at that line ;)