0

my java is not that great and i am trying to append the values in a linked list to a Text area however it is not displaying the values and i am getting an error but i cannot get to the bottom of it. Please help.

if (event.getSource()==btnDisplay)
    {   
        String s = "";
        Booking selectBooking = new Booking();

        txtArea.setText("");
        s="LessonType           No.InParty  Surname   Forename   InstructorCode \n";
        txtArea.append(s);
        s="--------------------------------------------------------------------------------\n";
        txtArea.append(s);

        ListIterator li = bookings.listIterator();
        while(li.hasNext());
        {
            s = li.next().toString();
            txtArea.append(s);
        }

    }

I am getting an error

s = li.next().toString();

Any help would be greatly appreciated. Thanks!!

MichaelG
  • 61
  • 8
  • You'll want to debug the NullPointerException (NPE) like you would any other NullPointerException. Please see the answers in the duplicate for more on this. – Hovercraft Full Of Eels Jan 03 '17 at 21:32
  • `i am getting an error` - we are not mind readers. Don't keep us in suspense. Tell us what the error is. Better yet search the forum for other people who have had the same error. If you need more help the post a proper [mcve] that demonstrates the problem. – camickr Jan 03 '17 at 21:55

0 Answers0