Question: Can Someone help me I'm getting a Nullpointer exception Line 544 is int result = personQueries.addPerson(firstNameTextField.getText(), lastNameTextField.getText(), emailTextField.getText(), phoneTextField.getText()); Its right before main personQueries is
Can Someone help me I'm getting a Nullpointer exception
Line 544 is
int result = personQueries.addPerson(firstNameTextField.getText(), lastNameTextField.getText(), emailTextField.getText(), phoneTextField.getText());
Its right before main
personQueries is another class
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at addressbookdisplay.AddressBookDisplay.insertButtonActionPerformed(AddressBookDisplay.java:544) at addressbookdisplay.AddressBookDisplay.access$500(AddressBookDisplay.java:45) at addressbookdisplay.AddressBookDisplay$6.actionPerformed(AddressBookDisplay.java:354) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)








import java.awt.event. ActionEvent; import java.awt.event. ActionListener; import java. awt.event. WindowAdapter; import java.awt.event. WindowEvent; import java.awt.FlowLayout; import java awt.GridLayout; import java.util.List; import javax.swing. JButton; import javax.swing. Box; import javax.swing.JFrame; import javax.swing.JLabel; import javax. swing. JPanel; import javax.swing. JTextField; import javax swing. WindowConstants; import javax.swing. BoxLayout import javax. swing. BorderFactory import javax swing. JOptionPane; public class AddressBookDisplay extends JFrame private Person currentEntry; private PersonQueries personQueries; private List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
