Results 1 to 4 of 4
  1. #1
    derekJava is offline Member
    Join Date
    Apr 2014
    Posts
    9
    Rep Power
    0

    Exclamation Need Help Starting this program

    I need to create an application that displays as a form, shown in the picture below. I'm new to JavaFX and I need help starting it.



    Need Help Starting this program-ddd.png

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,993
    Rep Power
    9

    Default Re: Need Help Starting this program

    Where are you stuck? What have you tried? What specifically are you confused about?

    You need to break your problem down into smaller pieces. What is the absolute smallest very next thing you know you need to do?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,103
    Rep Power
    6

    Default Re: Need Help Starting this program

    Quote Originally Posted by derekJava View Post
    I'm new to JavaFX and I need help starting it.
    Client Technologies: Java Platform, Standard Edition (Java SE) 8 Release 8

    Getting Started with JavaFX: About This Tutorial | JavaFX 2 Tutorials and Documentation

    just some of the top hits when searching for "javafx tutorial". The solution to your "problem" is quite simple but will take some effort: become less new to JavaFX!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    derekJava is offline Member
    Join Date
    Apr 2014
    Posts
    9
    Rep Power
    0

    Default Re: Need Help Starting this program

    Here is what I have thus far, I need help configuring to make this program work like the picture shown above.


    [code]



    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package pizzaorder;

    import java.awt.Font;
    import java.awt.Insets;
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.control.RadioButton;
    import javafx.scene.control.ToggleGroup;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;


    public abstract class PizzaOrder extends Application {
    //Text fields for both Name of Customer and Phone Number!!//


    GridePane gridpane = new GridPane();
    gridpane.setPadding(new Insets(5));
    gridpane.setHgap(5);
    gridpane.setVgap(5);

    Label fNameLbl = new Label("Name of Customer")
    TextField fNameFld = new textField();
    Label lPhoneLbl = new Label("Phone Number");
    TextField lPhoneFld = new TextField();
    //Name of customer label//
    GridPane.setHalignment(fNameLbl, HPos.RIGHT);
    gridpane.add(fNameLbl, 0, 0);
    //Phone Number Label//
    GridPane.setHalignment(fPhoneLbl, HPos.RIGHT);
    gridpane.add(fPhoneLbl, 0, 1);
    //Name of Customer Field//
    GridPane.setHalignment(fNameFld, HPos.LEFT);
    gridpane.add(fNameFld, 1, 0);
    //Phone Number Field//
    GridPane.setHalignment(fPhoneFld, HPos.LEFT);
    gridpane.add(lPhoneFld, 1, 1);

    root.getChildren().add(gridpane);
    }
    }






    //Size of Pizza//
    RadioButton rbSmall = new RadioButton ("Small");
    RadioButton rbMedium = new RadioButton ("Medium");
    RadioButton rbLarge = new RadioButton ("Large");
    ToggleGroup tgSize = new ToggleGroup();
    Label lblSize = new Label ("Size");


    protected VBox buildVpanel(){
    VBox pane = new VBox(5); //vertical gap//
    pane.setPadding(new Insets (10, 10, 10, 10));
    pane.getChildren().addAll(lblSize, rbSmall, rbMedium, rbLarge);
    lblSize.setFont(new Font("Arial", 14)); //("Font type", font size://
    rbSmall.setToggleGroup(tgSize);//these will make the other radio buttons turn off, when only clicking one radio button//
    rbMedium.setToggleGroup(tgSize);
    rbLarge.setToggleGroup(tgSize);


    return pane;
    }
    }
    class ReportHandler implements EventHandler<ActionEvent>{
    private Object rbMedium;
    private Object rbLarge;
    private Object rbSmall;
    public void handle(ActionEvent e) { //outputs selected option from the following radio buttons//
    System.out.print("Your size selection was ");
    if (rbSmall.isSelected()) {
    System.out.println("Small");
    }
    else if (rbMedium.isSelected()) {
    System.out.println("Medium");
    }
    else if (rbLarge.isSelected()) {
    System.out.println("Large");
    }
    //End of Size of Pizza
    Space between size of pizza and crust of pizza!!!!

    //Crust of Pizza//
    RadioButton rbRegular = new RadioButton ("Regular");
    RadioButton rbPan = new RadioButton ("Pan");
    RadioButton rbStuffed = new RadioButton ("Stuffed");
    ToggleGroup tgCrust = new ToggleGroup();
    Label lblCrust = new Label ("Crust");


    protected VBox buildVpanel(){
    VBox pane = new VBox(5); //vertical gap//
    pane.setPadding(new Insets (10, 10, 10, 10));
    pane.getChildren().addAll(lblCrust, rbRegular, rbPan, rbStuffed);
    lblCrust.setFont(new Font("Arial", 14)); //("Font type", font size://
    rbRegular.setToggleGroup(tgCrust);//these will make the other radio buttons turn off, when only clicking one radio button//
    rbPan.setToggleGroup(tgCrust);
    rbStuffed.setToggleGroup(tgCrust);


    return pane;
    }
    }
    class ReportHandler implements EventHandler<ActionEvent>{
    public void handle(ActionEvent e) { //outputs selected option from the following radio buttons//
    System.out.print("Your crust selection was ");
    if (rbRegular.isSelected()) {
    System.out.println("Regular");
    }
    else if (rbPan.isSelected()) {
    System.out.println("Pan");
    }
    else if (rbStuffed.isSelected()) {
    System.out.println("Stuffed");
    }
    //End of Crust of Pizza
    Space Between Crust and Toppings of Pizza
    //Toppings of Pizza//
    CheckBox cbSausage = new CehckBox ("Sausage");
    CheckBox cbPepperoni = new CheckBox ("Pepperoni");
    CheckBox cbMushrooms = new CheckBox ("Mushrooms");
    CheckBox cbPeppers = new CheckBox ("Peppers");
    ToggleGroup tgToppings = new ToggleGroup();
    Label lblToppings = new Label ("Toppings");


    protected VBox buildVpanel(){
    VBox pane = new VBox(5); //vertical gap//
    pane.setPadding(new Insets (10, 10, 10, 10));
    pane.getChildren().addAll(lblToppings, cbSausage, cbPepperoni, cbMushrooms, cbPeppers);
    lblToppings.setFont(new Font("Arial", 14)); //("Font type", font size://
    cbSausage.setToggleGroup(tgToppings);//these will make the other radio buttons turn off, when only clicking one radio button//
    cbPepperoni.setToggleGroup(tgToppings);
    cbMushrooms.setToggleGroup(tgToppings);
    cbPeppers.setToggleGroup(tgToppings);


    return pane;
    }
    }
    [\Code]

Similar Threads

  1. Need help starting world clock program
    By sebjavierw in forum New To Java
    Replies: 3
    Last Post: 05-17-2013, 01:02 PM
  2. Need help starting a program.
    By cagipple in forum New To Java
    Replies: 2
    Last Post: 09-19-2011, 07:35 PM
  3. Help with starting program please
    By SF163 in forum New To Java
    Replies: 5
    Last Post: 11-07-2009, 03:33 PM
  4. Need help starting program
    By mk3823 in forum New To Java
    Replies: 8
    Last Post: 11-02-2008, 01:41 AM
  5. just starting
    By specbailey in forum New To Java
    Replies: 23
    Last Post: 08-13-2007, 11:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •