Search:

Type: Posts; User: javapenguin

Search: Search took 0.10 seconds.

  1. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    I thought that might be the case.
  2. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    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...
  3. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    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.
  4. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    StudentGrades sg = null;

    Why null?
  5. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    Did you ever set action[0] to visible?
  6. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    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...
  7. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    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...
  8. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    if(e.getActionCommand().equals("Action 1"))
    {
    scores = sg.getTestGrades();

    for(int i = 0; i < scores.length; i++)
    {
    area[0].setVisible(true);...
  9. Replies
    15
    Views
    2,109

    Re: Problem with NullPointerException?

    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...
Results 1 to 9 of 9