Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main extends Application {
- @Override
- public void start(Stage primaryStage) throws Exception{
- Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
- primaryStage.setTitle("Hello World");
- primaryStage.setScene(new Scene(root));
- primaryStage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
- public class Controller {
- @FXML
- Rectangle tube = new Rectangle();
- public void onClick() throws InterruptedException {
- int x = 0;
- while(x < 100){
- Double a = tube.getX();
- Double b = tube.getY();
- tube.setX(a-5);
- x++;
- Thread.sleep(10);
- }
- }
- }
Add Comment
Please, Sign In to add comment