Почти сразу дошло до меня решение
может кому пригодится в будущем
нужно последнюю строку обернуть в Platform.runLater();
работающий метод будет выглядеть вот так
protected void calculationStart() {
double progress = 0.0;
String s1 = steamIdTextArea.getText();
int accountId = Integer.parseInt(s1);
MatchHistory history = null;
try {
history = api.getMatchHistory(MATCHES_AMOUNT, accountId);
} catch (RuntimeException e) {
System.out.println(e.getMessage());
System.out.println("Task can't be completed");
throw new RuntimeException("Closing ...");
} catch (IOException e) {
e.printStackTrace();
}
List<Long> matchesList = calc.matchIdList(history);
ArrayList<MatchDetails> matchDetailses = new ArrayList<>();
for (Long matchId : matchesList) {
try {
progress += 0.05;
matchDetailses.add(api.getMatchDetails(matchId));
final double finalProgress = progress;
Platform.runLater(() -> progressBar.setProgress(finalProgress));
} catch (IOException e) {
progress += 0.05;
final double finalProgress = progress;
resultText.setText(e.getMessage());
Platform.runLater(() -> progressBar.setProgress(finalProgress));
}
}
List<int[]> scoreList = calc.playerScore(matchDetailses, accountId);
double averageKDA = calc.averageKda(scoreList);
Platform.runLater(() -> resultText.setText("Average KDA for last " + MATCHES_AMOUNT + " rating games = " + averageKDA));
}