import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.effect.ImageInput; import javafx.scene.image.Image; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; publicclassImageInputEffectExampleextendsApplication { @Override publicvoidstart(Stage stage) { //Creating an image Imageimage=newImage("https://www.ljjyy.com/img/logo.png"); //Instantiating the Rectangle class Rectanglerectangle=newRectangle(); //Instantiating the ImageInput class ImageInputimageInput=newImageInput(); //Setting the position of the image imageInput.setX(150); imageInput.setY(100); //Setting source for image input imageInput.setSource(image); //Applying image input effect to the rectangle node rectangle.setEffect(imageInput); //Creating a Group object Grouproot=newGroup(rectangle); //Creating a scene object Scenescene=newScene(root, 600, 300); //Setting title to the Stage stage.setTitle("Sample Application"); //Adding scene to the stage stage.setScene(scene); //Displaying the contents of the stage stage.show(); } publicstaticvoidmain(String args[]){ launch(args); } }