import java.io.IOException; 
import javafx.animation.Interpolator; 
import javafx.animation.TranslateTransition; 
import javafx.application.Application; 
import javafx.fxml.FXMLLoader; 
import javafx.scene.Scene; 
import javafx.scene.layout.Pane; 
import javafx.scene.paint.Color; 
import javafx.scene.shape.Polygon; 
import javafx.stage.Stage; 
import javafx.util.Duration; 

public class Main extends Application{ 

private Scene testScene; 
private FXMLLoader testLoader; 
private Pane testPane; 
private Polygon polygon; 

@Override 
public void start(Stage primaryStage) throws Exception { 
    testLoader = new FXMLLoader(getClass().getResource("test.fxml")); 
    try { 
        testPane = (Pane) testLoader.load(); 
    } catch (IOException e) { 
        e.printStackTrace(); 
    } 
    testScene = new Scene(testPane, 500, 500); 
    primaryStage.setScene(testScene); 

    polygon = new Polygon(); 
    polygon.setFill(Color.DARKSLATEBLUE); 
    polygon.getPoints().setAll(new Double[]{ 50.0, 50.0, 70.0, 50.0, 70.0, 70.0, 50.0, 70.0 }); 

    TranslateTransition transition = new TranslateTransition(); 
    transition.setCycleCount(1); 
    transition.setDuration(Duration.seconds(3)); 
    transition.setNode(polygon); 
    transition.setFromX(0); 
    transition.setToX(0); 
    transition.setFromY(0); 
    transition.setToY(400); 
    transition.play(); 

    testPane.getChildren().add(polygon); 

    primaryStage.show(); 
} 

public static void main(String[] args) { 
    launch(args); 
 } 

} 