Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FastFoodOrderingSystem extends Application {
- String host = "jdbc:derby://localhost:1527/fooder";
- String username = "cho";
- String password = "cho";
- suport support = new suport();
- String str;
- String str1;
- @Override
- public void start( final Stage primaryStage) {
- Group root = new Group();
- Scene scene = new Scene(root, 1000, 650, Color.ORANGE);
- ImageView iv = new ImageView("img1a.png");
- iv.setLayoutX(330);
- iv.setLayoutY(10);
- iv.setFitHeight(282);
- iv.setFitWidth(500);
- iv.setSmooth(true);
- iv.setCache(true);
- root.getChildren().addAll(iv);
- Text tx = new Text("Name:");
- tx.setLayoutX (300);
- tx.setLayoutY (430);
- tx.setStyle("-fx-fill:white;");
- tx.setFont(Font.font("Cataneo BT", FontWeight.BOLD, 40));
- tx.setFontSmoothingType(FontSmoothingType.LCD);
- Text txx = new Text("Address:");
- txx.setLayoutX (300);
- txx.setLayoutY (490);
- txx.setStyle("-fx-fill:white;");
- txx.setFont(Font.font("Cataneo BT", FontWeight.BOLD, 40));
- txx.setFontSmoothingType(FontSmoothingType.LCD);
- final TextField tf = new TextField();
- tf.setLayoutX (550);
- tf.setLayoutY (405);
- tf.setPrefSize(300,40);
- tf.setPromptText("Enter name");
- // root.getChildren().addAll(tx,tf);
- final TextField tn = new TextField();
- tn.setLayoutX (550);
- tn.setLayoutY (455);
- tn.setPrefSize(300,40);
- tn.setPromptText("Enter Address here");
- root.getChildren().addAll(tx,tf,tn,txx);
- Text txt = new Text();
- txt.setText("n FAST FOOD ORDERING SYSTEM");
- txt.setLayoutX(110);
- txt.setLayoutY(5);
- txt.setStyle("-fx-fill:white;");
- txt.setFont(Font.font("Cataneo BT", FontWeight.BOLD, 55));
- txt.setFontSmoothingType(FontSmoothingType.LCD);
- Rectangle rect2 = new Rectangle();
- rect2.setFill(Color.WHITE);
- rect2.setLayoutX(0);
- rect2.setLayoutY(520);
- rect2.setHeight(5);
- rect2.setWidth(1500);
- Button btn = new Button("NEXT");
- btn.setPrefSize(200, 50);
- btn.setLayoutX(390);
- btn.setLayoutY(580);
- btn.setStyle("-fx-color:white; -fx-font-weight:bold; -fx-font-family:"Cataneo BT"; -fx-font-size:30");
- FadeTransition ft = new FadeTransition();
- ft.setDuration(Duration.millis(690));
- ft.setNode(btn);
- ft.setFromValue(1.0);
- ft.setToValue(0.5);
- ft.setCycleCount(Timeline.INDEFINITE);
- ft.setAutoReverse(true);
- ft.play();
- root.getChildren().add(btn);
- btn.setOnAction(new EventHandler<ActionEvent>() {
- String str = tn.getText();//address
- String str1 = tf.getText();//name
- @Override
- public void handle(ActionEvent event) {
- if (tf.getText() == null || tf.getText().trim().isEmpty() || tn.getText() == null || tn.getText().trim().isEmpty()) {
- // your code here
- }else{
- // try{
- // String sql = "insert into info(name,address) values ('"+tf.getText().toString()+"','"+tn.getText().toString()+"')";//,'"+txtCost.getText().toString()+"')
- // Connection con = DriverManager.getConnection(host,username,password);
- // Statement stmt = con.createStatement();
- // stmt.executeUpdate(sql);
- // }catch(SQLException ex){
- // //support.showAlert("sql connetion error",ex.getMessage(),Alert.AlertType.ERROR);
- // }
- CreateStage createStage = new CreateStage();
- }
- }
- });
- // // root.getChildren().add(btn);
- primaryStage.setTitle("G16 FOOD ORDERING SYSTEM");
- primaryStage.setScene(scene);
- primaryStage.setResizable(false);
- primaryStage.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement