Java Reference
In-Depth Information
String namePict = imagesFiles.get(indx);
final Image nextImage = new Image(namePict);
SequentialTransition seqTransition
= transitionByFading(nextImage, currentImageView);
seqTransition.play();
}
});
buttonGroup.getChildren().add(prevButton);
// next button
Arc nextButton = //... create arc
buttonGroup.getChildren().add(nextButton);
nextButton.addEventHandler(MouseEvent.MOUSE_PRESSED,
(MouseEvent me) -> {
int indx = gotoImageIndex(NEXT);
if (indx > -1) {
String namePict = imagesFiles.get(indx);
final Image nextImage = new Image(namePict);
SequentialTransition seqTransition
= transitionByFading(nextImage, currentImageView);
seqTransition.play();
}
});
//... the rest of the start(Stage primaryStage) method
public int gotoImageIndex(int direction) {
int size = imagesFiles.size();
if (size == 0) {
currentIndexImageFile = -1;
} else if (direction == NEXT && size > 1 &&
currentIndexImageFile < size - 1) {
currentIndexImageFile += 1;
} else if (direction == PREV && size > 1 &&
Search WWH ::




Custom Search