Advertisement
Guest User

Untitled

a guest
May 25th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package bank.client;
  7.  
  8. import static bank.client.BankClient.in;
  9. import static bank.client.BankClient.theStage;
  10. import javafx.event.ActionEvent;
  11. import javafx.geometry.Pos;
  12. import javafx.scene.Scene;
  13. import javafx.scene.control.Button;
  14. import javafx.scene.layout.GridPane;
  15. import javafx.scene.layout.VBox;
  16. import javafx.scene.text.Text;
  17.  
  18. /**
  19. *
  20. * @author DELL
  21. */
  22. public class AccounttypeScene {
  23. Text w = new Text("Account type");
  24. Button button1, button2,button3;
  25.  
  26. Scene getScene()
  27. {
  28. w.setId("type");
  29. button1 = new Button("Savings");
  30. button1.setOnAction(e->buttonCode(e));
  31. button2 = new Button("Loan");
  32. button2.setOnAction(e->buttonCode(e));
  33. button3 = new Button("Overdraft");
  34. button3.setOnAction(e->buttonCode(e));
  35. GridPane root = new GridPane();
  36. VBox root1 = new VBox();
  37. root.setAlignment(Pos.CENTER);
  38. root1.setAlignment(Pos.CENTER);
  39. button1.setPrefWidth(100);
  40. button2.setPrefWidth(100);
  41. button3.setPrefWidth(100);
  42. root1.setSpacing(20);
  43. root1.getChildren().addAll(button1, button2,button3);
  44. root.add(w, 0, 0);
  45. root.add(root1, 0, 1);
  46. Scene scene = new Scene(root, 512, 256);
  47. //scene.getStylesheets().add(DxBall.class.getResource("Introductory.css").toExternalForm());
  48. return scene;
  49. }
  50.  
  51. public void buttonCode(ActionEvent e)
  52. {
  53. if(e.getSource()==button1)
  54. {
  55. in=in + " Savings";
  56. ACinfo gScene = new ACinfo();
  57. Scene scene = gScene.getScene();
  58. theStage.setScene(scene);
  59. }
  60. else if(e.getSource()==button2)
  61. {
  62. in=in + " Loan";
  63. ACinfo gScene = new ACinfo();
  64. Scene scene = gScene.getScene();
  65. theStage.setScene(scene);
  66. }
  67. else if(e.getSource()==button3)
  68. {
  69. in=in + " Odraft";
  70. ACinfo gScene = new ACinfo();
  71. Scene scene = gScene.getScene();
  72. theStage.setScene(scene);
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement