Jestli to spravne chapu, tak tady si muzes vybrat:
private void handleScrollEvent(final ScrollEvent scrollEvent) {
}
private void test(final ScrollEvent scrollEvent) {
new Text().setOnScroll(this::handleScrollEvent);
new Text().setOnScroll((event -> {
handleScrollEvent(event);
}));
}