I am doing atm gui for my project in java. In my opinion using array of objects is the best option to store customer data. When i try to access it in an ActionListener method, i get this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException. This happens when i hit the register button. I tried to delete the array and use a normal object in the ActionListener and it worked smoothly but it is not useful to store multiple customer data. Is there another way to store these or to fix this error? I uploaded the source file so you can check the code. Thanks in advance.