This topic contains a solution. Click here to go to the answer

Author Question: Analyze the following code:import javafx.application.Application;import javafx.scene.Scene;import ... (Read 89 times)

berenicecastro

  • Hero Member
  • *****
  • Posts: 581
Analyze the following code:

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.stage.Stage;

public class Test extends Application {
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
HBox pane = new HBox(5);
Image usIcon = new Image("http://www.cs.armstrong.edu/liang/image/usIcon.gif");
Button bt1 = new Button("Button1", new ImageView(usIcon));
Button bt2 = new Button("Button2", new ImageView(usIcon));
pane.getChildren().addAll(bt1, bt2);

Scene scene = new Scene(pane, 200, 250);
primaryStage.setTitle("Test"); // 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.
*/
public static void main(String[] args) {
launch(args);
}
}

◦ Two buttons displayed with the same icon.
◦ Two buttons displayed with different icons.
◦ Only bt2 displays the icon and bt1 does not display the icon.
◦ Only bt1 displays the icon and bt2 does not display the icon.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by berenicecastro on May 6, 2020

softEldritch

  • Sr. Member
  • ****
  • Posts: 334
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 25% of students answer this correctly




berenicecastro

  • Member
  • Posts: 581
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


adf223

  • Member
  • Posts: 304
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

IgA antibodies protect body surfaces exposed to outside foreign substances. IgG antibodies are found in all body fluids. IgM antibodies are the first type of antibody made in response to an infection. IgE antibody levels are often high in people with allergies. IgD antibodies are found in tissues lining the abdomen and chest.

Did you know?

There are over 65,000 known species of protozoa. About 10,000 species are parasitic.

Did you know?

The term bacteria was devised in the 19th century by German biologist Ferdinand Cohn. He based it on the Greek word "bakterion" meaning a small rod or staff. Cohn is considered to be the father of modern bacteriology.

Did you know?

Increased intake of vitamin D has been shown to reduce fractures up to 25% in older people.

Did you know?

Human neurons are so small that they require a microscope in order to be seen. However, some neurons can be up to 3 feet long, such as those that extend from the spinal cord to the toes.

For a complete list of videos, visit our video library