Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

FIX THE CODE. How to add URL (http://www.cs.armstrong.edu/liang/image/us.gif ) to this code to display the image us.gif? import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane;

FIX THE CODE. How to add URL (http://www.cs.armstrong.edu/liang/image/us.gif ) to this code to display the image us.gif?

import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.geometry.Insets; import javafx.stage.Stage; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import java.net.URL;

public class ShowImage extends Application { @Override // Override the start method in the Application class public void start(Stage primaryStage){ // Create a pane to hold the image views Pane pane = new HBox(10); pane.setPadding(new Insets(5, 5, 5, 5)); Image image = new Image("image/us.gif"); pane.getChildren().add(new ImageView(image)); ImageView imageView2 = new ImageView(image); imageView2.setFitHeight(100); imageView2.setFitWidth(100); pane.getChildren().add(imageView2);

ImageView imageView3 = new ImageView(image); imageView3.setRotate(90); pane.getChildren().add(imageView3); // Create a scene and place it in the stage Scene scene = new Scene(pane); primaryStage.setTitle("ShowImage"); // Set the stage title primaryStage.setScene(scene); // Place the scene in the stage primaryStage.show(); // Display the stage } /** * The main method is only needed for the IDE with limited * JavaFX support. Not needed for running from the command line. * @param args */ public static void main(String[] args) { launch(args); }

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

List out some inventory management techniques.

Answered: 1 week ago

Question

5. A review of the key behaviors is included.

Answered: 1 week ago