Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This class defines the search scene that is created and put into the stage. It will perform a lookup (not really truly a search) of

This class defines the search scene that is created and put into the stage. It will perform a lookup (not really truly a search) of the customer array when given a valid index number for the array.

This class header must be:

public class SearchPanel

(Hint: make the objects declared at the class level as public static.)

The design of the window is up to you. You are strongly encouraged to design the window on paper first, carefully considering which layout you might use. It must be user friendly with some directions to the user. It must include at a minimum:

● 3 Button objects: Search, Clear, Return.

● 1 TextField for the user to enter a number which corresponds to the index of the CusObjects array in MakeCustObject

● TextArea and ScrollPane. The TextArea will display the search results, and the ScrollPane will put scroll bars on the TextArea when the results are too large to fit.

● Feel free to add more GUI objects if you like, and many Labels are necessary that are not noted above.

In the setOnAction, detect what button the user pressed and perform the following actions: 

 

  • Search by Number - Validates the number entered is a positive integer; if valid, displays the customer object at that spot in the array using the toString method from the Customer blueprint class for that spot in the array; if not valid, displays an error message
  • Clear - clears all inputs on the panel;
  • Return - makes the user return to the MainWindow.

 

Important Note: when you are referring to an array, you'll need to use the class name. Examples of the code you might write (you could have different variable names you are using):

MakeCustObjects.CustObjects[i]

MakeCustObjects.CustObjects[targetCustID]

 

SearchPanel.java 

 

 

 

 

 


Step by Step Solution

There are 3 Steps involved in it

Step: 1

import javafxapplicationPlatform import javafxscenecontrol import javafxscenelayout import javafxsce... 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

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Programming questions

Question

The following sample observations were randomlyselected.

Answered: 1 week ago