Created
November 5, 2019 15:45
-
-
Save matyklug18/7ae8365746737a5e79240ac65d457c5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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