Java Reference
In-Depth Information
currentImageView.setImage(image);
}
});
// move button group when scene is resized
buttonGroup.translateXProperty().bind(scene.widthProperty().subtract(buttonArea.getWidth()
+ 6));
buttonGroup.translateYProperty().bind(scene.heightProperty().subtract(buttonArea.getHeight()
+ 6));
root.getChildren().add(buttonGroup);
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* Returns the next index in the list of files to go
to next.
*
* @param direction PREV and NEXT to move backward or
forward in the list of
* pictures.
* @return int the index to the previous or next
picture to be shown.
*/
public int gotoImageIndex(ButtonMove direction) {
int size = imageFiles.size();
if (size == 0) {
currentIndex = -1;
} else if (direction == ButtonMove.NEXT && size >
1 && currentIndex < size - 1) {
currentIndex += 1;
} else if (direction == ButtonMove.PREV && size >
1 && currentIndex > 0) {
currentIndex -= 1;
}
Search WWH ::




Custom Search