Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How does mood-congruent recall affect consumer behavior?

Answered: 1 week ago