Guest User

Untitled

a guest
Nov 24th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public PizzaPane()
  2. {
  3. Font font = new Font(18);
  4.  
  5.  
  6.  
  7. CheckBox cb1 = new CheckBox("Bacon");
  8. CheckBox cb2 = new CheckBox("Peppers");
  9. CheckBox cb3 = new CheckBox("Sausage");
  10. CheckBox cb4 = new CheckBox("Extra Cheese");
  11. CheckBox cb5 = new CheckBox("Ham");
  12. CheckBox cb6 = new CheckBox("Onions");
  13.  
  14. Button push = new Button("Total!");
  15. push.setOnAction(this::processReturn);
  16.  
  17. Label outputLabel = new Label("Property Output:");
  18. outputLabel.setFont(font);
  19. GridPane.setHalignment(outputLabel, HPos.RIGHT);
  20.  
  21. result = new Label("---");
  22. result.setFont(font);
  23. GridPane.setHalignment(result, HPos.CENTER);
  24.  
  25.  
  26. setAlignment(Pos.CENTER);
  27. setHgap(50);
  28. setVgap(20);
  29. setStyle("-fx-background-color: yellow");
  30. setGridLinesVisible(false);
  31.  
  32.  
  33.  
  34. add(cb1 , 1, 2);
  35. add(cb2 , 1, 3);
  36. add(cb3 , 1, 4);
  37. add(cb4 , 1, 5);
  38. add(cb5 , 1, 6);
  39. add(cb6 , 1, 7);
  40. add(push, 2, 0);
  41. add(outputLabel, 0, 1);
  42. add(result, 1, 1);
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. }
  50. public void processReturn(ActionEvent event)
  51.  
  52. {
  53.  
  54. double fValue =(10);
  55.  
  56. result.setText(fValue + "");
  57. }
Add Comment
Please, Sign In to add comment