Skip to content

Instantly share code, notes, and snippets.

@matyklug18
Created November 5, 2019 15:45
Show Gist options
  • Save matyklug18/7ae8365746737a5e79240ac65d457c5d to your computer and use it in GitHub Desktop.
Save matyklug18/7ae8365746737a5e79240ac65d457c5d to your computer and use it in GitHub Desktop.
root.setOnScroll((ScrollEvent event) -> {
Task task = new Task() {
@Override protected Void call() throws Exception {
Platform.runLater(()->{
System.out.println(index);
if(event.getDeltaY()==-40.0){
index ++;
int cachedSize = addons.size();
for(Addon adn:CurseAPIWrapper.searchAddons("", GameVersion.STABLE, Section.MODS, 1, index))
addons.add(adn);
for (int ii = cachedSize; ii < addons.size(); ii++) {
myGroup.getChildren().add(new AddonView(ii, size, addons));
}
}
});
return null;
}
};
Thread th = new Thread(task);
th.setDaemon(true);
th.start();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment