Guest User

Untitled

a guest
Apr 20th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class Main extends Application {
  2.  
  3. @Override
  4. public void start(Stage primaryStage) throws Exception{
  5. Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
  6. primaryStage.setTitle("Hello World");
  7. primaryStage.setScene(new Scene(root));
  8. primaryStage.show();
  9. }
  10.  
  11.  
  12. public static void main(String[] args) {
  13. launch(args);
  14. }
  15. }
  16.  
  17. public class Controller {
  18.  
  19. @FXML
  20. Rectangle tube = new Rectangle();
  21.  
  22.  
  23. public void onClick() throws InterruptedException {
  24. int x = 0;
  25. while(x < 100){
  26. Double a = tube.getX();
  27. Double b = tube.getY();
  28. tube.setX(a-5);
  29. x++;
  30. Thread.sleep(10);
  31. }
  32.  
  33. }
  34.  
  35.  
  36. }
Add Comment
Please, Sign In to add comment