Por que estou recebendo java.lang.IllegalStateException “Não no thread do aplicativo FX” no JavaFX?

Eu tenho um aplicativo que tem umTableView que tem um ouvinte anexado para que ele seja atualizado assim que detectar uma alteração, mas a coisa é que estou ficandojava.lang.IllegalStateException: Not on FX application thread; currentThread = Smack Listener Processor (0). Aqui está o meu código:

/**
 * This function resets the pagination pagecount
 */
public void resetPage() {
    try {
        System.out.println("RESET"); 
        int tamRoster = this.loginManager.getRosterService().getRosterList().size();
        paginationContactos.setPageCount((int)(Math.ceil(tamRoster*1.0/limit.get())));
        int tamEnviados = this.loginManager.getRosterService().getEnviadasList().size();
        paginationEnviadas.setPageCount((int)(Math.ceil(tamEnviados*1.0/limit.get())));
        int tamRecibidas = this.loginManager.getRosterService().getRecibidasList().size();
        paginationRecibidas.setPageCount((int)(Math.ceil(tamRecibidas*1.0/limit.get())));
    } catch (Exception e) {
        e.printStackTrace();
    }
}

public void doSomething () {
        this.loginManager.getRosterService().getRosterList().addListener(new ListChangeListener<RosterDTO>() {
            @Override
            public void onChanged(
                    javafx.collections.ListChangeListener.Change<? extends RosterDTO> c) {
                // TODO Auto-generated method stub
                resetPage();
                while (c.next()) {
                    if (c.wasPermutated()) {
                        System.out.println("PERM");
                    } else if (c.wasUpdated()) {
                        System.out.println("UPD");
                    } else {
                        System.out.println("ELSE");
                    }
                }
            }
         });
}

Embora ele entre no método resetPage, recebo essa exceção. Por que isso está acontecendo? Como posso consertar isso? Desde já, obrigado.

questionAnswers(2)

yourAnswerToTheQuestion