import javafx.application.Application; import javafx.beans.binding.Bindings; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ColorPicker; import javafx.scene.control.Label; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; public class Bug extends Application { private ColorPicker colorPicker; @Override public void start(Stage primaryStage) throws Exception { Button set = new Button("set"); colorPicker = new ColorPicker(Color.web("#996699")); Label label = new Label(); label.textProperty().bind(Bindings.convert(colorPicker.valueProperty())); VBox vbox = new VBox(); vbox.getChildren().setAll(set, label, colorPicker); set.setOnAction(new EventHandler() { @Override public void handle(ActionEvent t) { colorPicker.setValue(Color.AQUA); // colorPicker.valueProperty().set(Color.RED); } }); primaryStage.setScene(new Scene(vbox, 200, 200)); primaryStage.show(); } /** * Java main for when running without JavaFX launcher */ public static void main(String[] args) { launch(args); } }