Hi,
What is the correct way to do the following? I've got a panel which is a typical search criteria and results form. Before doing setPanel(myPanel), I need to populate a combobox with values from the db and then populate a table with results also coming from the db. The method to populate the table first gets the select combobox item to use as a search criteria. First I tried the following:
But this is wrong because it might happen that the 2nd swingworker.work() runs first than the 1st swingworker.updateUI() which will cause wrong behaviour. I know several ways to solve this but:
1) I don't want to use SwingUtilities.invokeAndWait() to populate the combobox
2) I don't think doing a .get() to the 1st SwingWorker is correct
3) I don't know if putting the 2nd swingworker inside the updateUI() method of the first one is ok?
This must be a typical use case so you guys must know how to do it properly. Thanks in advance!
[ September 23, 2008: Message edited by: J. Nuno ]
What is the correct way to do the following? I've got a panel which is a typical search criteria and results form. Before doing setPanel(myPanel), I need to populate a combobox with values from the db and then populate a table with results also coming from the db. The method to populate the table first gets the select combobox item to use as a search criteria. First I tried the following:
But this is wrong because it might happen that the 2nd swingworker.work() runs first than the 1st swingworker.updateUI() which will cause wrong behaviour. I know several ways to solve this but:
1) I don't want to use SwingUtilities.invokeAndWait() to populate the combobox
2) I don't think doing a .get() to the 1st SwingWorker is correct
3) I don't know if putting the 2nd swingworker inside the updateUI() method of the first one is ok?
This must be a typical use case so you guys must know how to do it properly. Thanks in advance!
[ September 23, 2008: Message edited by: J. Nuno ]