Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package bank.client;
- import static bank.client.BankClient.in;
- import static bank.client.BankClient.theStage;
- import javafx.event.ActionEvent;
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.VBox;
- import javafx.scene.text.Text;
- /**
- *
- * @author DELL
- */
- public class AccounttypeScene {
- Text w = new Text("Account type");
- Button button1, button2,button3;
- Scene getScene()
- {
- w.setId("type");
- button1 = new Button("Savings");
- button1.setOnAction(e->buttonCode(e));
- button2 = new Button("Loan");
- button2.setOnAction(e->buttonCode(e));
- button3 = new Button("Overdraft");
- button3.setOnAction(e->buttonCode(e));
- GridPane root = new GridPane();
- VBox root1 = new VBox();
- root.setAlignment(Pos.CENTER);
- root1.setAlignment(Pos.CENTER);
- button1.setPrefWidth(100);
- button2.setPrefWidth(100);
- button3.setPrefWidth(100);
- root1.setSpacing(20);
- root1.getChildren().addAll(button1, button2,button3);
- root.add(w, 0, 0);
- root.add(root1, 0, 1);
- Scene scene = new Scene(root, 512, 256);
- //scene.getStylesheets().add(DxBall.class.getResource("Introductory.css").toExternalForm());
- return scene;
- }
- public void buttonCode(ActionEvent e)
- {
- if(e.getSource()==button1)
- {
- in=in + " Savings";
- ACinfo gScene = new ACinfo();
- Scene scene = gScene.getScene();
- theStage.setScene(scene);
- }
- else if(e.getSource()==button2)
- {
- in=in + " Loan";
- ACinfo gScene = new ACinfo();
- Scene scene = gScene.getScene();
- theStage.setScene(scene);
- }
- else if(e.getSource()==button3)
- {
- in=in + " Odraft";
- ACinfo gScene = new ACinfo();
- Scene scene = gScene.getScene();
- theStage.setScene(scene);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement