Answered step by step
Verified Expert Solution
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.ioFile;
Mouse Rollover
public class Main extends Application
public static void mainString args
Launch the application.
launchargs;
@Override
public void startStage 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.setScenescene;
primaryStage.show;
the name for the file for the flowers:
flowerjpg
flowerjpg
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started