May 2021 5 44 Report
¿Error java.lang.NullPointerException?

A qué se debe este error?

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at meth.busca(meth.java:32) at Prin1$6.actionPerformed(Prin1.java:142) at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.jav a:6267) at javax.swing.JComponent.processMouseEvent(JComponen t.java:3267) at java.awt.Component.processEvent(Component.java:603 2) at java.awt.Container.processEvent(Container.java:204 1) at java.awt.Component.dispatchEventImpl(Component.jav a:4630) at java.awt.Container.dispatchEventImpl(Container.jav a:2099) at java.awt.Component.dispatchEvent(Component.java:44 60) at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4168) at java.awt.Container.dispatchEventImpl(Container.jav a:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478 ) at java.awt.Component.dispatchEvent(Component.java:44 60) at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599) at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)

Actualizar:

Del fichero meth...

public void busca(meth pasa, String clav)

{

if(pasa.clave2.equals(clav)) <---Linea 32

JOptionPane.showMessageDialog(null,"Encontró ");

}

Desde donde lo invoco

b4.addActionListener(new ActionListener()

{

public void actionPerformed(ActionEvent x)

{

meth llevar=new meth();

meth llevar2=new meth();

String clav=tf4.getText();

int i;

for(i=0;i<xd.size();i++)

llevar.busca(llevar2,clav);

}

});

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.