Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA source code (JAVAFX) on eclipse please Tasks This lab has four parts: Create a window. Create two (2) text fields, a clickable button and

JAVA source code (JAVAFX) on eclipse please

Tasks

This lab has four parts:

  1. Create a window.
  2. Create two (2) text fields, a clickable button and a label/text object on the window.
  3. Create an event handler for entered text in the text fields.
  4. Create an event handler for the button to add the two text fields and display that in the label/text object.

Task 1 Window

Open a GUI project and create a window. The default code provided with the GUI project will accomplish this, so we will move on to the next topic.

Task 2 Create GUI Elements

Create two text fields, a button and a label and place them on the GUI window. The text fields will be able to take user input and display the text as they write it, similar to the email and password fields on a login page. The button was covered in the previous lab. Finally, the label will act as a piece of text on the window. It is different from the text fields since it cannot be directly written into by the user.

Task 3 The Text Field Event Handlers

The next thing to do is to add the event handlers to the text fields so that after the user writes some text into them and presses enter, we will save the input into the text fields. The process for this will be similar to the button event handler from the last lab.

Task 4 The Button Event Handler

Lastly, we will need to create an event handler for the button that takes the text from both of the text fields and adds them (the user should enter numbers, so this will be addition NOT concatenation) and displays the result of that addition by changing the text of the label to that result.

Some Sample Output:

image text in transcribed

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

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

What is plant layout?

Answered: 1 week ago

Question

Demonstrate three aspects of assessing group performance?

Answered: 1 week ago