I thought that might be the case.
Type: Posts; User: javapenguin
I thought that might be the case.
Well, you didn't define it before
scores = sg.getTestGrades();
so it's still null.
That's why I was asking why it is null there.
You could always have the method click the construct...
StudentGrades sq = null;
scores = sg.getTestGrades();
yeah, your first if statement may define sq, but if the if condition is false, it won't go there. So it'll still be null.
StudentGrades sg = null;
Why null?
Did you ever set action[0] to visible?
Was sq first defined in your actionPerformed(ActionEvent e) method, inside that if statement for the button "Construct"?
sg = new StudentGrades(students);
If so, then it won't know what sq is...
You only need to tell it to set visible once. Sometimes I've done it more than once, by accident, or just to figure out why it wasn't showing up, but a for loop to keep telling it that seems kind of...
if(e.getActionCommand().equals("Action 1"))
{
scores = sg.getTestGrades();
for(int i = 0; i < scores.length; i++)
{
area[0].setVisible(true);...
Maybe you never initialized the array.
Or the button.
It could be because scores is defined inside an if statement and may not have a scope beyond that if statement so it could be there but be...