Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Examine the code and figure out how to add another button to the GUI. Have this button double the number that the user enters. You

Examine the code and figure out how to add another button to the GUI. Have this button double the number that the user enters. You will have to modify code in multiple files to accomplish this.

Add a fourth button, name it, and wire It to accomplish that function.

Paste a screen shot of your four-action GUI with the correct result from one of your buttons.

**********Java File**********************************************************************

/* Simple Math Operations Using Buttons

*/

import java.net.URL;

import javafx.application.Application;

import javafx.fxml.FXMLLoader;

import javafx.scene.layout.VBox;

import javafx.scene.Scene;

import javafx.stage.Stage;

public class SimpleMathPractice extends Application

{

@Override

public void start( Stage stage ) // throws Exception

{

try

{

URL url =

getClass( ).getResource( "fxml_simple_math.fxml" );

VBox root = FXMLLoader.load( url );

Scene scene = new Scene( root, 300, 275 );

scene.getStylesheets( ).add( "simple_math.css" );

stage.setTitle( "Simple Math" );

stage.setScene( scene );

stage.show( );

}

catch ( Exception e )

{

e.printStackTrace( );

}

}

public static void main( String [] args )

{

launch( args );

}

}

**********************Fxml File*************************************

"1.0" encoding="UTF-8"?>

"SimpleMathController"

xmlns:fx="http://javafx.com/fxml"

alignment="center" spacing="10" >

"operand" maxWidth="100" />

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

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago