The JavaFX ColorPicker control enables the user to choose a color in a popup dialog. The chosen color can later be read from the ColorPic...
The JavaFX ColorPicker control enables the user to choose a color in a popup dialog. The chosen color can later be read from the ColorPicker by your JavaFX application. The JavaFX ColorPicker control is represented by the class javafx.scene.control.ColorPicker. Here is a screenshot of an opened JavaFX ColorPicker:
Source Code : @Override public void start(Stage primaryStage) { primaryStage.setTitle("JavaFX colorPicker"); ColorPicker colorPicker = new ColorPicker(); Color value = colorPicker.getValue(); VBox vBox = new VBox(colorPicker); Scene scene = new Scene(vBox, 800, 600); primaryStage.setScene(scene); primaryStage.show(); } Libraries Importing : import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.ColorPicker; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage;
COMMENTS