イメージは適当i用意してください。
java
1import javafx.application.Application;
2import javafx.scene.Scene;
3import javafx.scene.control.Slider;
4import javafx.scene.image.Image;
5import javafx.scene.image.ImageView;
6import javafx.scene.layout.StackPane;
7import javafx.scene.layout.VBox;
8import javafx.stage.Stage;
9import java.io.File;
10
11public class xxImages {
12 public static void main(String[] args) {
13 Application.launch(App.class, args);
14 }
15
16 public static class App extends Application {
17 @Override
18 public void start(Stage stage) throws Exception {
19
20 final ImageView aaImage = new ImageView(new Image(new File("/tmp/aa.jpeg").toURI().toURL().toString()));
21 final ImageView bbImage = new ImageView(new Image(new File("/tmp/bb.jpeg").toURI().toURL().toString()));
22 final StackPane stackPane = new StackPane(aaImage, bbImage);
23
24 final Slider slider = new Slider(0.0, 1.0, 0.5);
25 bbImage.opacityProperty().bind(slider.valueProperty());
26
27 stage.setScene(new Scene(new VBox(stackPane, slider)));
28 stage.setTitle(this.getClass().getName());
29 stage.show();
30 }
31 }
32}