title: JavaFx. Login Page link to next page
body: <p>I really need help here. I'm new into this <code>gui</code> and <code>javaFx</code>. I've been doing this coding but don't know how to link it. Both of my codes is working properly. the idea is, when sign in button is clicked the source code 2 will appear. but now, I do the source codes on different class. please help me. thanks</p>
  
  <p>My source code 1 :</p>
  
  <pre><code>import java.awt.event.ActionListener;
  import javafx.application.Application;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.geometry.HPos;
  import javafx.geometry.Insets;
  import javafx.geometry.Pos;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.control.TextField;
  import javafx.scene.layout.ColumnConstraints;
  import javafx.scene.layout.GridPane;
  import javafx.scene.layout.HBox;
  import javafx.scene.layout.Pane;
  import javafx.scene.layout.Priority;
  import javafx.scene.layout.StackPane;
  import javafx.scene.layout.VBox;
  import javafx.scene.text.Font;
  import javafx.scene.text.FontWeight;
  import javafx.scene.text.Text;
  import javafx.stage.Stage;
  
  /**
   *
   * @author Win10
   */
  public class ProjectFlower extends Application {
  
      private static final double WindowWidth  = 600;
      private static final double WindowHeight = 400;
      Button B1;
  
      @Override
      public void start(Stage primaryStage) throws Exception{
          primaryStage.setTitle("Flowerstyle Net");
  
          GridPane GP = new GridPane();
          GP.setAlignment(Pos.CENTER);
          GP.setHgap(10);
          GP.setVgap(10);
          GP.setPadding(new Insets(10,10,10,10));
          GP.setPrefSize(WindowWidth,WindowHeight);
          GP.setMinSize(WindowWidth,WindowHeight);
  
          ColumnConstraints left = new ColumnConstraints();
          left.setHalignment(HPos.RIGHT);
          left.setHgrow(Priority.NEVER);
  
          ColumnConstraints right = new ColumnConstraints();
          right.setHgrow(Priority.ALWAYS);
  
          GP.getColumnConstraints().addAll(left,right);
  
          Text text = new Text("\t\t\t\t WELCOME TO FLOWERSTYLE NET" + "\n\n\t\t\t\t\t " + "ENJOY YOUR SHOPPING!! :)");
          text.setFont(Font.font("SHOWCARD GOTHIC", FontWeight.NORMAL,20));
          GP.add(text,0,0,2,1);
  
          GridPane.setHalignment(text,HPos.LEFT);
  
          Label L1 = new Label("User Name");
          GP.add(L1,0,1);
  
          Label L2 = new Label ("Password");
          GP.add(L2,0,2);
  
          TextField TF1 = new TextField();
          GP.add(TF1,1,1);
  
          TextField TF2 = new TextField();
          GP.add(TF2,1,2);
  
          Button B1 = new Button ("Sign in");
          GP.add(B1,1,3);
          GridPane.setHalignment(B1,HPos.CENTER);
  
          GP.setStyle("-fx-background-color : grey");
  
          Scene scene = new Scene(GP,WindowWidth,WindowHeight);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
      public static void main(String[] args) {
          launch(args);
      }
  
  }
  </code></pre>
  
  <p>Source code 2 :</p>
  
  <pre><code>import java.awt.TextArea;
  import javafx.application.Application;
  import javafx.geometry.Insets;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.scene.Group;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.ComboBox;
  import javafx.scene.control.Label;
  import javafx.scene.control.ListView;
  import javafx.scene.control.TextField;
  import javafx.scene.layout.GridPane;
  import javafx.stage.Stage;
  
  public class CusInfo extends Application {
  
      public static void main(String[] args) {
          launch(args);
      }
  
      //final Button button = new Button("Proceed");
      //final Label notification = new Label ();
      final TextField TF = new TextField("");
      final TextArea TA = new TextArea("");
  
      String address = " ";
  
      @Override
      public void start(Stage stage){
          stage.setTitle("Customer Information");
          Scene scene1 = new Scene(new Group(),450,250);
  
          final ListView LV = new ListView();
          LV.getItems().addAll(
          "ROSE",
          "TULIPS",
          "LILY",
          "CARNATION",
          "LAVENDER",
          "ORCHID",
          "SUNFLOWER",
          "LILAC",
          "HYACINTH",
          "DAISIES",
          "FORGET ME NOT",
          "PRIMROSE",
          "CAMELLIAS",
          "CHERRY BLOSSOM",
          "BIRD OF PARADISE"
          );
  
          final ComboBox CB1 = new ComboBox();
          CB1.getItems().addAll(
          "WHITE",
          "BLUE",
          "RED",
          "PURPLE",
          "BLACK",
          "YELLOW",
          "ORANGE"
          );
  
          final ComboBox CB2 = new ComboBox();
          CB2.getItems().addAll(
          "ENGLAND",
          "AMSTERDAM",
          "MALAYSIA",
          "ICELAND",
          "AUSTRALIA"
          );
  
          CB2.setValue("MALAYSIA");
  
          GridPane pane = new GridPane();
          pane.setVgap(4);
          pane.setHgap(10);
          pane.setPadding(new Insets(5,5,5,5));
  
             Label name = new Label ("Customer Name:");
             pane.add(name,0,0);
             TextField nameField = new TextField();
             pane.add(nameField,1 , 0);
  
             Label OrderID = new Label ("Order ID:");
             pane.add(OrderID, 0, 1);
             TextField OrderField = new TextField();
             pane.add(OrderField,1 ,1 );
  
             Label date = new Label ("Date:"); 
             pane.add(date,0,2);
             TextField dateField = new TextField();
             pane.add(dateField,1 , 2);
  
             Label phoneNum = new Label ("Phone Number:");
             pane.add(phoneNum,0,3);
             TextField phoneField = new TextField();
             pane.add(phoneField,1 , 3);
  
             pane.add (new Label ("Type of Flower:"),0,4);
             pane.add(LV,1,4);
             //TextField flowerField = new TextField();
             //pane.add(flowerField,1 , 4);
  
             pane.add( new Label ("Flower Colour:"),0,5);
             pane.add(CB1,1,5);
             //TextField colourField = new TextField();
             //pane.add(colourField,1 , 5);
  
             pane.add( new Label ("Origin:"),0,6);
             pane.add(CB2,1,6);
             //TextField originField = new TextField();
             //pane.add(colourField,1 , 6);
  
             Label quantity = new Label ("Quantity:");
             pane.add(quantity,0,7);
             TextField quantityField = new TextField();
             pane.add(quantityField,1 , 7);
  
             Label totalPrice = new Label ("Total Price:");
             pane.add(totalPrice,0,8); 
             TextField priceField = new TextField();
             pane.add(priceField,1,8);
  
             Label address = new Label ("Customer Address:");
             pane.add(address,0,9);
             TextField addressField = new TextField();
             pane.add(addressField,1 , 9);
  
             Button button = new Button("Proceed");
             pane.add(button, 1, 10);
  
             Group root = (Group)scene1.getRoot();
             root.getChildren().add(pane);
             stage.setScene(scene1);
             stage.show();
  </code></pre>