import javafx.application.Application; 
import javafx.geometry.Pos; 
import javafx.scene.Scene; 
import javafx.scene.control.Button; 
import javafx.scene.image.Image; 
import javafx.scene.layout.VBox; 
import javafx.stage.Stage; 

public class HelloWorld extends Application { 

    @Override 
    public void start(Stage primaryStage) throws Exception { 
        primaryStage.setTitle("Hello World"); 

        Image icon = new Image("http://docs.oracle.com/javafx/javafx/images/javafx-documentation.png"); 
        primaryStage.getIcons().add(icon); 

        Button gcButton = new Button("Click this button and then resize application window."); 
        gcButton.setOnAction(e -> System.gc()); 

        VBox root = new VBox(gcButton); 
        root.setAlignment(Pos.CENTER); 

        primaryStage.setScene(new Scene(root, 600, 400)); 
        primaryStage.show(); 
    } 
} 
