Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Description Using JavaFX and any of its associated controls, create a Java GUI a

ID: 3605628 • Letter: D

Question

Description Using JavaFX and any of its associated controls, create a Java GUI application that recreates a physical interface. Examples include items like microwaves, calculators, ATMs, car radios, media players, or any other devices. You may choose any real-world object as long as you fulfill the listed requirements. Your program should use a minimum of .5 UI Components (e.g. Button, Label, TextField, etc.) At least one component must be an Image combined with an ImageView. That combination counts as 1 of the 5 Ul components if used, e.g. 1 Image with 1 o ImageView counts as 1 of 5 components. 3 different types of Panes o At least one Pane must contain another Pane (e.g. FlowPane containing a VBox) 1 bound property Node property customization (changing styles, colors, etc.) Other requirements and notes Your program should indicate, in the comment header, the object you are recreating. If the object you are using is not common, include a link to a representative picture o You may not use any of the items represented in In-Class Assignment 1 A portion of your grade (up to 30%) will be based on how well the program represents the object you are emulating, within the limits of JavaFX. o Effective use of images will help fulfill this requirement

Explanation / Answer

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Text;
import javafx.geometry.Orientation;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Priority;
import javafx.stage.Stage;

public class GridPaneExample extends Application
{
@Override
public void start(Stage stage)
{

GridPane gridPane = new GridPane();
FlowPane flowpane = new FlowPane();

//Creating Components
Lablel l1=new Label("Enter your name");
TextField t1=new TextField(30);
Button button1 = new Button("microwaves");
Button button2 = new Button("calculators");
Button button3 = new Button("ATM");
Button button4 = new Button("Car radios");
Button button5 = new Button("Media players");

flowpane.getChildren().add(l1);
flowpane.getChildren().add(t1);

gridPane.add(button1 ,1,0);
gridPane.add(button2 ,0,1);
gridPane.add(button3 ,3,1);
gridPane.add(button4 ,3,2);
gridPane.add(button5 ,3,3);
flowpane.add(gridpane);

//Creating a scene object
Scene scene = new Scene(flowpane, 200, 100);

stage.setScene(scene);
stage.setTitle("GridPane Example 1");
stage.show();
}
public static void main(String[] args)
{
Application.launch(args);
}
}