0

I am using the jsoup to get data from different URLs. I am trying to add them to my JTable. However it is only added after the entire thread completes, i.e. only after going through every URL, data is updated in JTable.

Here is what I do to update my JTable:

String rowData2[] = {title, city};
model.addRow(rowData2);

How can I make java to wait for updating this before moving on to next iteration of my loop for scraping data?

Tagir Valeev
  • 97,161
  • 19
  • 222
  • 334
BuxHzk
  • 11
  • 1
  • Could you please provide the code where you actually read the data? Shorten it if possible, removing irrelevant details. In which thread you are reading the data? AWT-EventQueue? Swing worker? Manually created thread? – Tagir Valeev May 13 '15 at 07:10
  • I do this in a JFrame class in the main thread. I didn't create a separate thread for any of the operation. Similar to something we do in the main method of a JFrame class – BuxHzk May 13 '15 at 07:14

0 Answers0