I have a class called departments. In a main Jframe, I create an array of objects of this class and give a value to the first two positions of the array:
Here is how I declare the table:
Then, from a Jdialog, I try to get the data from the array to display them in a textArea:
But when running it, I skip a null pointer exception in the line that tries to take the department number.
What is the reason for this if the array has values?