Question: i need help coding the foloowing in java. Instructions: Create an application that displays an image. When the user moves the mouse pointer over the

i need help coding the foloowing in java.
Instructions:
Create an application that displays an image. When the user moves the mouse pointer over the image, it should change to a second image. The second image should remain displayed as long as the mouse pointer is over it. When the user moves the mouse pointer away from the second image, it should change back to the first image.
program outline:
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.geometry.Pos;
import javafx.geometry.Insets;
import javafx.scene.control.Slider;
import javafx.scene.control.Label;
import javafx.scene.effect.ColorAdjust;
import javafx.stage.FileChooser;
import java.io.File;
/**
* Mouse Rollover
*/
public class Main extends Application
{
public static void main(String[] args)
{
// Launch the application.
launch(args);
}
@Override
public void start(Stage primaryStage)
{
// Load the images
// Create an ImageView
// Register event handlers
// Put everything into a VBox
// Add the main VBox to a scene.
// Set the scene to the stage aand display it.
primaryStage.setScene(scene);
primaryStage.show();
}
}
the name for the file for the flowers:
flower_01.jpg
flower_02.jpg

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!