import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.effect.ColorInput; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; publicclassColorInputEffectExampleextendsApplication { @Override publicvoidstart(Stage stage) { //creating a rectangle Rectanglerectangle=newRectangle(); //Instantiating the Colorinput class ColorInputcolorInput=newColorInput(); //Setting the coordinates of the color input colorInput.setX(50); colorInput.setY(140); //Setting the height of the region of the collor input colorInput.setHeight(50); //Setting the width of the region of the color input colorInput.setWidth(400); //Setting the color the color input colorInput.setPaint(Color.CHOCOLATE); //Applying coloradjust effect to the Rectangle rectangle.setEffect(colorInput); //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); } }