Question: code in java please,, here is a copy of my code for the last lab and a screenshot of the quastation please add the animation

code in java please,, here is a copy of my code for the last lab and a screenshot of the quastation please add the animation to it --------------------------------------------------------------------------------------------------------------------------------------------------------------- import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.stage.Stage; public class Lab15 extends Application{ @Override public void start(Stage stage){ Pane pane =new HBox(); ImageView imageView =new ImageView(); Image [] images = new Image[3]; images[0]= new Image("C:/Users/you14/Downloads/canva-photo-editor-8-7.jpg"); images[1]= new Image("C:/Users/you14/Downloads/download.jpeg"); images[2]= new Image("C:/Users/you14/Pictures/Screenshots/Screenshot_20221026_021557.png"); imageView.setFitWidth(350); // set the width of the image imageView.setPreserveRatio(true); // set the height of the image imageView.setImage(images[first]); // set the image to the image view //when you reach the end of the array disable the next button Button next = new Button("Next"); next.setOnAction(e->{ if(first < images.length-1){ first++; imageView.setImage(images[first]); } else{ next.setDisable(true); }}); //when you reach the beginning of the array disable the previous button Button previous = new Button("Previous"); previous.setOnAction(e->{ if(first >0){ first--; imageView.setImage(images[first]); } else{ previous.setDisable(true); }}); Scene scene = new Scene(pane,500,500); // set the size of the scene pane.getChildren().addAll(next,imageView,previous); // add the buttons and image view to the layout stage.setTitle("Lab15"); stage.setScene(scene); stage.show(); } int first=0; public static void main(String[] args){ launch(args); }}------------------------------------------------------------------------------------------------------------------------------- Objectives: In this lab, the following topic will be covered: 1. Animation Task Add to the previous lab a button slideshow that displays an image from an array of images then after two seconds the next image is displayed and so on. When you reach the last image, reverse the direction. When you reach the first image, reverse the direction.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!