0

I tryed both ActionListener and Lambda for a jButton but i am getting the below error: AWT-EventQueue-0" java.lang.NullPointerException at com.ibm.eNetwork.ECL.ECLPS.SendKeys(Unknown Source) at com.ibm.eNetwork.ECL.ECLPS.SendKeys(Unknown Source) at CI.SCMgrCEE.CustomActionListener.actionPerformed(CustomActionListener.java:157) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method)

At the line 157 is the below:

psess.GetPS().SendKeys(String, 8, 18);

The String is a number that i got from an excel file.

What i am doing wrong?

ChristosV
  • 35
  • 1
  • 10
  • 1
    This has nothing to do with Swing, ActionListener, or Lambda and all to do with you have a NPE and need to debug it. Look at the dup question for steps on how to do this. Specifically test each variable on line 157 to see which reference is null, then look back into your code to see why. – Hovercraft Full Of Eels Feb 20 '16 at 23:19
  • 1
    Btw, do not name a variable `String`. – pzaenger Feb 20 '16 at 23:20
  • I second @pzaenger's recommendation. Also learn and follow Java naming conventions, including giving classes names that start with upper case letters, and fields and variables names that don't. – Hovercraft Full Of Eels Feb 20 '16 at 23:22

0 Answers0