I am populating a JTable with an ArrayList that contains necessary packet data. My JTable populates after all of the packets are received rather than one by one. I am using the Jnetpcap library and I believe I am having a thread issue.
I have implemented a Swing Worker in my Capture Class but I was wondering where to put the doInBackground() effectively. I read up on concurrency so I am thinking it's the issue here, my syntax is off. Do I need a Table Model and if so, where to implement?
EDIT: public class Capture extends SwingWorker {
//Variables
protected doInBackground() throws Exception {
//Get Packets
//Convert data to ArrayList
pulish(list);
PCap.loop(10, jPacketHandler, null);
PCap.close();
So basically the loop will get 10 packets but the Table only updates once the packets are received in PCap.close(); I know my Swing is being blocked somehow but I am not sure where.
My GUI class calls this method explicitly (doInBackground)