Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

@Override public void init() throws Exception { //TODO initialize the controller and set the builder to it. //TODO initialize the dialog. //TableView has replaced the

@Override public void init() throws Exception {

//TODO initialize the controller and set the builder to it. //TODO initialize the dialog.

//TableView has replaced the old WebView Node as the center of the application. //TODO Initialize the table variable. //TODO call TableView::setPlaceholder on table and pass to it a new Label with argument "No Data".

Region optionsBar = createOptionsBar(); Region statusBar = createStatusBar();

root = new BorderPane(); root.setRight( optionsBar); root.setCenter( table); root.setBottom( statusBar); }

/** *

* this method is called when JavaFX application is started and it is running on JavaFX thread. this method must at * least create {@link Scene} and finish customizing {@link Stage}. these two objects must be on JavaFX thread when * created. *

*

* {@link Stage} represents the frame of your application, such as minimize, maximize and close buttons. * {@link Scene} represents the holder of all your JavaFX {@link Node}s. * {@link Node} is the super class of every javaFX class. *

* * @param primaryStage - primary stage of your application that will be rendered */ @Override public void start( Stage primaryStage) throws Exception { // dialog needs to be initialized in start as it needs to be on JavaFX thread. dialog.init(); // scene holds all JavaFX components that need to be displayed in Stage Scene scene = new Scene( root, WIDTH, HEIGHT); primaryStage.setScene( scene); primaryStage.setTitle( TITLE); primaryStage.setResizable( true); // when escape key is pressed close the application primaryStage.addEventHandler( KeyEvent.KEY_RELEASED, ( KeyEvent event) -> { if ( KeyCode.ESCAPE == event.getCode()) { primaryStage.hide(); } }); // display the JavaFX application primaryStage.show(); }

/** * this method is called at the very end when the application is about to exit. this method is used to stop or * release any resources used during the application. */ @Override public void stop() throws Exception { //TODO if controller is not null close it. }

/** * create a {@link VBox} that represent the right side of the application. * * @return customized {@link VBox} as subclass of {@link Region}. * @throws SQLException */ private Region createOptionsBar() throws SQLException {

//To create the TextField, ComboBox, and Button use the static methods //from common.CommonGUIBuilder class.

//TODO create a TextField called searchText and pass to it "" and "Search Text" //TODO create a ComboBox< String> called tablesCombo and pass to it controller.getTableNames(), "Table", and 0

//TODO on controller call tableInUseProperty() and then call bind and pass to it tablesCombo.getSelectionModel().selectedItemProperty() //this line of code binds the selected item in the combo box to the controllers tableInUseProperty. //so whenever the user changes the table selection the controller also updates.

//TODO create a Button called connectButton and pass to it "Connect" and a lambda to be executed when clicked. //call setText on conectionStatus pass to it "connecting". //call dialog.showAndWait() if the result is false : //call setText on conectionStatus pass to it "cancelled". //if the result is true: //call connect and then getTableNames on controller. we call getTableNames again just to update the names. the list is already connected to ComboBox. //call setText on conectionStatus pass to it "connected". //don't forget connect throws an exception, so use try and catch. //if exception is thrown, setText on conectionStatus pass to it "failed: " + ex.getMessage() and call ex.printStackTrace();

//TODO create a Button called searchButton and pass to it "Search" and a lambda to be executed when clicked. //if controller is not connected call setText on conectionStatus pass to it "must connect first" and get out. //call setText on conectionStatus pass to it "searching". //call search on controller and pass searchText.getText().trim(). store the result in a variable called list. //if list is not null setText on conectionStatus to "populating table" and call populateTextArea( list). //finally call setText on conectionStatus and pass to it "finished". //don't forget connect throws an exception, so use try and catch. //if exception is thrown, setText on conectionStatus pass to it "failed: " + ex.getMessage() and call ex.printStackTrace();

//TODO call setOnAction on searchText and use rule 3 to execute searchButton.fire().

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 Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago