Problems with Carrental program
Hi, I can't search bookings in my carrental program. I get:
"Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"
the line that needs to be corrected is:
(first line is working)
textFieldCustomerNo.setText(controller.findBooking (textFieldBookingNo.getText()).getCustomer().getCu stomerNo());
textFieldRegNo.setText(controller.findBooking(text FieldBookingNo.getText()).getVehicle().getRegNo()) ;
When I try to get the date, CustomerNo and the Vehicle, only the date works. The only diffenence between the lines is that the first one is getting the Strings from the class "Booking" and the two other lines get the Strings from 2 classes.("Vehicle" and "Customer")
Re: Problems with Carrental program
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.