Forums Register Login

getting an error "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExcept"

+Pie Number of slices to send: Send
Hi ranchers,

I am getting an error while executing a swing application.on the click of a button,I am capturing the inputs passed by an user and passing them to my another programme,but i am getting the following error

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException.

code for actionperformed method is as follows.

public void actionPerformed(ActionEvent e)
{
if ("submit".equals(e.getActionCommand()))
{
variables = new HashMap(); // declared the swing class.
variables.put("ServiceURL",url.getText());
variables.put("Value",ssn.getText());
variables.put("CallingAppRole",prtcpnt_id.getText());
variables.put("Life Event Code",life_evnt_cd.getText());
variables.put("Envoirnment",envoirnment.getSelectedItem());
WSTestHarness testHarness = new WSTestHarness();
testHarness.setgui_swing(variables);
testHarness.executeTestSession();
}
}





Thanks in advance.

Regards,
Abhijeet Shrivastava
+Pie Number of slices to send: Send
Take a look at the full stack trace. It should tell you in which line the NPE occurs, which should make it rather obvious which variable is null.
He was expelled for perverse baking experiments. This tiny ad is a model student:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 918 times.
Similar Threads
Basic GUI problem :(
Unable to run pgm. when in jar....
getting an error "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExcept"
Please help with a simple GUI.
NullPointerException when I close window
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:32:10.