| Author |
How can I use the Class JpcapCaptor loopPacket method without blocking my Windows app
|
Sam Picture
Greenhorn
Joined: Nov 07, 2008
Posts: 2
|
|
If I use the Class JpcapCaptor processPacket method this application gets a run-time "java.lang.NoSuchMethodError: setRoutingOption" error and it closes, and no packets are captured or displayed. I would like to be able to use this method because unlike the Class JpcapCaptor loopPacket method it will not block the application's event dispatching thread which is used by its graphical user interface and prevent me from being able to interact with it to stop the capture process, print the capture information, etc. If I use the Class JpcapCaptor loopPacket method this application gets a run-time "java.lang.NoSuchMethodError: setRoutingOption" error and it continues, and packets are captured and displayed. However, as previously mentioned this method blocks the application's event dispatching thread which is used by its graphical user interface which prevents me from being able to interact with it to stop the capture process, print the capture information, etc. Since I cannot use the Class JpcapCaptor processPacket method, I need to find a way to use the Class JpcapCaptor loopPacket method that will not block the application's event dispatching thread. One way might be to have the method use a separate thread, for example a SwingWorker worker thread. There are probably some other ways to do it, as well. I am a beginning Java programmer and I do not understand how to do any of them. I need help! I am visually oriented. Please include example code, not just text explanations so that I can understand the solution you propose.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Check out JProgressBar Doesn't Update. Although these days, SwingWorker is a much nicer way to solve it.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: How can I use the Class JpcapCaptor loopPacket method without blocking my Windows app
|
|
|