The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 314 Weeks Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
Â
Â
public class FXDriver extends Application {
 Â
/**
* The main method for the GUI example program JavaFX version
* @param args not used
* @throws IOException
*/
public static void main(String[] args) {
launch(args);Â Â
}
@Override
public void start(Stage stage) throws IOException {
//student Task #1:
//Â instantiate the FXMainPane, name it root
//Â set the scene to hold root
//set stage title
stage.setTitle("Hello World GUI");
//display the stage
stage.show();
Â
}
}
Â
Â
/**
 * The DataManager class should never depend on the GUI, but rather the reverse.Â
 * So the DataManager methods should not use the GUI directly. If you want data
 * to get from the user to the manager, have the GUI get the data, and call the managerÂ
 * with the data that the GUI got from a text field or other data structure.
 * @author ralexander
 *
 */
public class DataManager {
  Â
DataManager() { }
Â
/**Â
* This method illustrates how the GUI can interact with the manager
*/
public String getHello() {
return "Hello World";
}
Â
public String getHowdy() {
return "Howdy y'all";
}
Â
public String getChinese() {
return "Ni hau";
}
Â
Â
}
Â
Â
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
Â
/**
 * This panel is the basic panel, inside which other panels are placed. Â
 * Before beginning to implement, design the structure of your GUI in order toÂ
 * understand what panels go inside which ones, and what buttons or other components
 * go in which panels. Â
 * @author ralexander
 *
 */
//make the main panel's layout be a VBox
public class FXMainPane extends VBox {
Â
//student Task #2:
//Â declare five buttons, a label, and a textfield
//Â declare two HBoxes
//student Task #4:
//Â declare an instance of DataManager
/**
* The MainPanel constructor sets up the entire GUI in this approach. Remember to
* wait to add a component to its containing component until the container has
* been created. This is the only constraint on the order in which the followingÂ
* statements appear.
*/
FXMainPane() {
//student Task #2:
//Â instantiate the buttons, label, and textfield
//Â instantiate the HBoxes
//student Task #4:
//Â instantiate the DataManager instance
//Â set margins and set alignment of the components
//student Task #3:
//Â add the label and textfield to one of the HBoxes
//Â add the buttons to the other HBox
//Â add the HBoxes to this FXMainPanel (a VBox)
}
//Task #4:
//Â a private inner class to handle the button clicks
}
Attachments:
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly