Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me write this Java program using JavaFX. We are using the latest version of Java 8. Please post screenshots of your code and
Please help me write this Java program using JavaFX. We are using the latest version of Java 8. Please post screenshots of your code and ouptut since it is easier to see the format that way. Thank You!
Also, please use simple 'Stage' and 'Scene' elements for this GUI. We can use 'BorderPane', 'FlowPane', buttons, labels, etc.
DO NOT use items like the 'javafx.collections' library for things like 'ObservableList'.
PLEASE ONLY USE THE ELEMENTS FOUND IN THESE JavaFX LIBRARIES :
import javafx.application.*; import javafx.stage.*; import javafx.scene.*; import javafx.scene.layout.*; import javafx.scene.control.*; import javafx.geometry.*; import javafx.scene.text.*; import javafx.event.*;
This may be used for the output of the MessageBox if you want:
import javafx.application.*; import javafx.stage.*; import javafx.scene.*; import javafx.scene.layout.*; import javafx.scene.control.*; import javafx.geometry.*; // create a simple dialog box public class MessageBox { public static void show(String message, String title) { Stage stage = new Stage(); // initModality() method specifies stage displayed as a modal stage.initModality(Modality.APPLICATION_MODAL); stage.setTitle(title); stage.setMinWidth(250); Label lbl = new Label(); lbl.setText(message); Button btnOK = new Button(); btnOK.setText("OK"); // event handler using lambda expression // when user clicks OK the stage is close (message box disappears) btnOK.setOnAction(e -> stage.close()); // VBox layout pane VBox pane = new VBox(20); pane.getChildren().addAll(lbl, btnOK); pane.setAlignment(Pos.CENTER); Scene scene = new Scene(pane); stage.setScene(scene); stage.showAndWait(); } }Create a simplified calculator GUI using JavaFX. Here is a mockup to give you an idea of what the primaryStage should look like File My Mini Calculator First number Second number Subtract Multiply Divide Clear Result The user enters a "First number" and "Second number" and then presses a button for four available mathematical operations: "Add", "Subtract", "Multiply", and "Divide". The results are then displayed to the right of "Result: ". Pressing the "Clear" button will clear the two text fields and the result When the "File" menu is clicked, an "About" menu item will appear. When "Abou?" is clicked, a modal window will appear with information about your application. (Your name should appear here.) When the "OK" button is clicked, the modal window should close File My Mini Calculator First number Designed by Jane Doe in California Second number Subtract Multiply Divide OK Clear Resul
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