• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
abhijeet shrivastava
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!