Null Pointer Exception:::Please Help
Here is the code that is giving some exceptions.
publicvoid capturePacketsFromDevice()
{
startCaptureThread();
}
publicvoid setCaptureFrame(CaptureFrame frame)
{
this.frame=frame;
}
publicvoid stopCapture()
{
if(isCapturing ==true)
{
stopCaptureThread();
}
}
private Thread captureThread;
privatevoid startCaptureThread()
{
isCapturing =true;
if (captureThread !=null)
return;
try
{
captureThread =new Thread(new Runnable(){
JpcapCaptor jpcap = JpcapCaptor.openDevice(JpcapCaptor.getDeviceList()[3], 2000, false, 200);
publicvoid run()
{
while (captureThread !=null)
{
jpcap.processPacket(1, handler);
Thread.yield();
}
jpcap.close();
jpcap =null;
}
});
}
catch(Exception e)
{
}
-->captureThread.setPriority(Thread.MIN_PRIORITY);
frame.startUpdating();
>captureThread.start();
}
void stopCaptureThread()
{
isCapturing =false;
captureThread =null;
frame.stopUpdating();
}
The Exceptions Are :
Exception in Thread"AWT-EventQueue-0" java.lang.NullPointerException
at PacketCaptor.startCaptureThread (PacketCaptor.java.86)
at PacketCaptor.capturePacketsFromDevice(PacketCaptor.java.38)
I've marked the line numbers as "->"
Please help....

