Advertisement
Guest User

test

a guest
Sep 19th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. package oefening4;
  2.  
  3.  
  4. import javafx.scene.control.Label;
  5. import javafx.scene.control.Spinner;
  6. import javafx.scene.control.TextField;
  7. import javafx.scene.input.MouseEvent;
  8.  
  9. public class Controller {
  10. public Spinner spStap;
  11. public TextField txtLocationX;
  12. public TextField txtLocationY;
  13. public Label lblPong;
  14.  
  15.  
  16.  
  17. public void Clicked_Top(MouseEvent mouseEvent) {
  18. Double dblHeight = lblPong.getHeight();
  19. lblPong.setLayoutY(dblHeight-(Double) spStap.getValue());
  20.  
  21. }
  22.  
  23. public void Clicked_TopLeft(MouseEvent mouseEvent) {
  24. lblPong.setLayoutY(lblPong.getHeight()-(Double) spStap.getValue());
  25. lblPong.setLayoutX(lblPong.getWidth()-(Double) spStap.getValue());
  26. }
  27.  
  28. public void Clicked_TopRight(MouseEvent mouseEvent) {
  29. lblPong.setLayoutY(lblPong.getHeight()-(Double) spStap.getValue());
  30. lblPong.setLayoutX(lblPong.getWidth()+(Double) spStap.getValue());
  31. }
  32.  
  33. public void Clicked_Left(MouseEvent mouseEvent) {
  34. lblPong.setLayoutX(lblPong.getWidth()-(Double) spStap.getValue());
  35. }
  36.  
  37. public void Clicked_BottomRight(MouseEvent mouseEvent) {
  38. lblPong.setLayoutX(lblPong.getWidth()+(Double) spStap.getValue());
  39. lblPong.setLayoutY(lblPong.getHeight()+(Double) spStap.getValue());
  40. }
  41.  
  42. public void Clicked_Bottom(MouseEvent mouseEvent) {
  43. lblPong.setLayoutY(lblPong.getHeight()+(Double) spStap.getValue());
  44. }
  45.  
  46. public void Clicked_right(MouseEvent mouseEvent) {
  47. lblPong.setLayoutX(lblPong.getWidth()+(Double) spStap.getValue());
  48. }
  49.  
  50. public void Clicked_BottomLeft(MouseEvent mouseEvent) {
  51. lblPong.setLayoutX(lblPong.getWidth()-(Double) spStap.getValue());
  52. lblPong.setLayoutY(lblPong.getHeight()+(Double) spStap.getValue());
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement