I have a problem in my swing app.
I have a SwingWorker
that has a for loop inside, that launches 300+ oracle database requests and populates several JTable
s with the results.
If I keep the swing app window not-minimised, or at least partly visible in the windows explorer, the batch completes fine. Now, if I minimise the app, and then go back to the swing app, it will be frozen.
Basic outline and colours of the components will be visible, most of the window will be just of the background colour I set to it (black) and no text will be visible. The only way to kill the app is by killing the process, since I clicking on 'X' button will not shut the window down.
Is this a common issue? How do you prevent it?
Loop inside the batch worker:
for(int i=1; i<=maxDepth; i++){
String[] result = getAllLists(database, i);
for(int j=0; j<result.length; j++){
String period=result[j];
for(String name : names){
System.out.println("New Query: "+name+ " " + period + " | " + "Loading " + (days) + " days x " + years + " years --- ");
if(isValid(period,name)){
List<TickHistory> queryResult = model.getByDaysMultiple(name,period,days+mod+daysHeadroom,years, false);
getModelTableData(name, period, DatabaseHelpers.dateToString(lastCob), years,days,queryResult);
populatePricesTable(queryResult, days, false);
view.setNameText(name);
view.setPeriodText(period);
}else{
System.out.println("query invalid");
}
}
}
}