1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ahat [919]
4 years ago
11

In this assignment, you will write a user interface for your calculator using JavaFX. Your graphical user interface (GUI) should

look like the screenshot below (creativity is good, but you also need to be able to design to customer specifications). When the user closes the window, the program should end. For this assignment the GUI does not need to respond to any other user input. Note that we are developing this GUI completely separately from any class. This is a common design pattern that is often called ModelView-Controller, or MVC. The model is the data your program deals with, the view is the user interface, and the controller responds to input from the view by acting on the data in the model. Developing programs in this way allows you to create diffe

Engineering
1 answer:
Zolol [24]4 years ago
4 0

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import javafx.application.Application;

import javafx.stage.Stage;

import javafx.scene.Group;

import javafx.scene.Scene;

import javafx.scene.layout.VBox;

import javafx.scene.layout.HBox;

import javafx.scene.control.TextField;

import javafx.scene.control.Button;

public class Calculator extends Application {

public static void main(String[] args) {

// TODO Auto-generated method stub

launch(args);

}

"at"Override

public void start(Stage primaryStage) throws Exception {

// TODO Auto-generated method stub

Group root = new Group();

VBox mainBox = new VBox();

HBox inpBox = new HBox();

TextField txtInput = new TextField ();

txtInput.setEditable(false);

txtInput.setStyle("-fx-font: 20 mono-spaced;");

txtInput.setText("0.0");

txtInput.setMinHeight(20);

txtInput.setMinWidth(200);

inpBox.getChildren().add(txtInput);

Scene scene = new Scene(root, 200, 294);

mainBox.getChildren().add(inpBox);

HBox rowOne = new HBox();

Button btn7 = new Button("7");

btn7.setMinWidth(50);

btn7.setMinHeight(50);

Button btn8 = new Button("8");

btn8.setMinWidth(50);

btn8.setMinHeight(50);

Button btn9 = new Button("9");

btn9.setMinWidth(50);

btn9.setMinHeight(50);

Button btnDiv = new Button("/");

btnDiv.setMinWidth(50);

btnDiv.setMinHeight(50);

rowOne.getChildren().addAll(btn7,btn8,btn9,btnDiv);

mainBox.getChildren().add(rowOne);

HBox rowTwo = new HBox();

Button btn4 = new Button("4");

btn4.setMinWidth(50);

btn4.setMinHeight(50);

Button btn5 = new Button("5");

btn5.setMinWidth(50);

btn5.setMinHeight(50);

Button btn6 = new Button("6");

btn6.setMinWidth(50);

btn6.setMinHeight(50);

Button btnMul = new Button("*");

btnMul.setMinWidth(50);

btnMul.setMinHeight(50);

rowTwo.getChildren().addAll(btn4,btn5,btn6,btnMul);

mainBox.getChildren().add(rowTwo);

HBox rowThree = new HBox();

Button btn1 = new Button("1");

btn1.setMinWidth(50);

btn1.setMinHeight(50);

Button btn2 = new Button("2");

btn2.setMinWidth(50);

btn2.setMinHeight(50);

Button btn3 = new Button("3");

btn3.setMinWidth(50);

btn3.setMinHeight(50);

Button btnSub = new Button("-");

btnSub.setMinWidth(50);

btnSub.setMinHeight(50);

rowThree.getChildren().addAll(btn1,btn2,btn3,btnSub);

mainBox.getChildren().add(rowThree);

HBox rowFour = new HBox();

Button btnC = new Button("C");

btnC.setMinWidth(50);

btnC.setMinHeight(50);

Button btn0 = new Button("0");

btn0.setMinWidth(50);

btn0.setMinHeight(50);

Button btnDot = new Button(".");

btnDot.setMinWidth(50);

btnDot.setMinHeight(50);

Button btnAdd = new Button("+");

btnAdd.setMinWidth(50);

btnAdd.setMinHeight(50);

rowFour.getChildren().addAll(btnC,btn0,btnDot,btnAdd);

mainBox.getChildren().add(rowFour);

HBox rowFive = new HBox();

Button btnEq = new Button("=");

btnEq.setMinWidth(200);

btnEq.setMinHeight(50);

rowFive.getChildren().add(btnEq);

mainBox.getChildren().add(rowFive);

root.getChildren().add(mainBox);

primaryStage.setScene(scene);

primaryStage.setTitle("GUI Calculator");

primaryStage.show();

}

}

You might be interested in
The components of an electronic system dissipating 90 W are located in a 1-m-long circular horizontal duct of 15-cm diameter. Th
Artyom0805 [142]

Answer:

Given data

 electronic system dissipating = 90 W

diameter = 15 cm

The components in the duct are cooled by forced air which enters at 32°C at a rate of 0.65 m3 /min

the duct and the remaining = 15 %

See pictures for solution.

Explanation:

See attached pictures for detailed explanation.

4 0
3 years ago
Water is pumped from one large reservoir to another at a higher elevation. If the flow rate is 2.5 ft3 /s and the pump delivers
4vir4ik [10]

Answer:

2132hp  ed enregia

e

Explanation:

dawdsawdsawdsawdsawdsawdsawdaas

6 0
4 years ago
What are the 5 major forest types?
Nataly [62]

Answer:

1. Equatorial Evergreen or Rainforest

2. Tropical forest

3. Mediterranean forest

4. Temperate broad-leaved forest

5. Warm temperate forest

Explanation:

4 0
4 years ago
Read 2 more answers
A polymeric extruder is turned on and immediately begins producing a product at a rate of 10 kg/min. An operator realizes 20 min
hodyreva [135]

Answer:

The plot of the function production rate m(t) (in kg/min) against time t (in min) is attached to this answer.

The production rate function M(t) is:

m(t)=[H(t)\cdot10+H(t-20)\cdot5-H(t-80)\cdot14+H(t-81)\cdot9]kg/min (1)

The Laplace transform of this function is:

\displaystyle m(s)=[\frac{10+5e^{-20s}-14e^{-80s}+9e^{-81s}}{s}]kg/min    (2)

Explanation:

The function of the production rate can be considered as constant functions by parts in the domain of time. To make it a continuous function, we can use the function Heaviside (as seen in equation (1)). To join all the constant functions, we consider at which time the step for each one of them appears and sum each function multiply by the function Heaviside.

For the Laplace transform we use the following rules:

\mathcal{L}[f(x)+g(x)]=\mathcal{L}[f(x)]+\mathcal{L}[g(x)]=F(s)+G(s)    (3)

\mathcal{L}[aH(x-b)]=\displaystyle\frac{ae^{-bs}}{s}    (4)

4 0
4 years ago
What does WCS stand for? A. Western CAD System B. Worldwide Coordinate Sectors C. World Coordinate System D. Wrong CAD Settings
Ray Of Light [21]

Answer:

The correct answer is C. World Coordinate System

Explanation:

The World Coordinate System has to do with that coordinate system which is fixed in the activities of the CADing. There is a default system in which we can refer to them as soon as we want to manipulate the objects and add new elements.

7 0
4 years ago
Other questions:
  • Open root weld coupons generally have an bevel angle of?
    7·1 answer
  • Steam enters an adiabatic nozzle at l MPa, 260 C, 30 m/s and exits at 0.3 MPa and 160 'C. Calculate the velocity at the exit.
    13·1 answer
  • The three resistors in the circuit shown have values of 4ohms 4ohms and 2ohms. The battery has a value of 12 volts. What is the
    11·1 answer
  • Consider a rectangular wing mounted in a full-scale wind tunnel. The wing model completely spans the test section so that the fl
    6·1 answer
  • The housing for a certain machinery product is made of two components, both aluminum castings. The larger component has the shap
    10·1 answer
  • B/ Evaluate e^(πi/2)
    9·2 answers
  • 35 points and brainiest is it A, B, C, D
    10·2 answers
  • Q5) Write C++ program to find the summation of sines of the even values that can be divided by 7 between -170 and -137.
    11·1 answer
  • How to calculate tension.
    6·1 answer
  • A simple Brayton cycle using air as the working fluid has a pressure ratio of 10.9. The minimum and maximum temperatures in the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!