-
Bug
-
Resolution: Fixed
-
P3
-
7u6
-
2.2.0b05
Run attached code:
import com.sun.javafx.scene.control.ColorPicker;
import javafx.application.Application;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class JavaFXColorPicker extends Application {
public static void main(String[] args) {
launch(args);
}
ColorPicker testedColorPicker = new ColorPicker();
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
vb.getChildren().addAll(testedColorPicker, setValueHbox(), setColorHbox());
Scene scene = new Scene(vb, 200, 200);
stage.setScene(scene);
stage.show();
}
private HBox setValueHbox() {
HBox hb = new HBox();
Label lb = new Label("Set value");
final TextField colorTf = TextFieldBuilder.create().prefWidth(100).build();
Button bt = ButtonBuilder.create().text("Set!").build();
bt.setOnAction(new EventHandler() {
@Override
public void handle(Event t) {
System.out.println("Color : " + Color.web(colorTf.getText()));
testedColorPicker.setValue(Color.web(colorTf.getText()));
System.out.println(testedColorPicker.getValue());
}
});
hb.getChildren().addAll(lb, colorTf, bt);
return hb;
}
private HBox setColorHbox() {
HBox hb = new HBox();
Label lb = new Label("Set color");
final TextField colorTf = TextFieldBuilder.create().prefWidth(100).build();
Button bt = ButtonBuilder.create().text("Set!").build();
bt.setOnAction(new EventHandler() {
@Override
public void handle(Event t) {
System.out.println("Color : " + Color.web(colorTf.getText()));
testedColorPicker.setColor(Color.web(colorTf.getText()));
System.out.println(testedColorPicker.getColor());
}
});
hb.getChildren().addAll(lb, colorTf, bt);
return hb;
}
}
If I type "aaaaaa" in any of textFields, I don't see affecting of the setters. (getters work, but control doesn't change image)
import com.sun.javafx.scene.control.ColorPicker;
import javafx.application.Application;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
public class JavaFXColorPicker extends Application {
public static void main(String[] args) {
launch(args);
}
ColorPicker testedColorPicker = new ColorPicker();
@Override
public void start(Stage stage) throws Exception {
VBox vb = new VBox();
vb.getChildren().addAll(testedColorPicker, setValueHbox(), setColorHbox());
Scene scene = new Scene(vb, 200, 200);
stage.setScene(scene);
stage.show();
}
private HBox setValueHbox() {
HBox hb = new HBox();
Label lb = new Label("Set value");
final TextField colorTf = TextFieldBuilder.create().prefWidth(100).build();
Button bt = ButtonBuilder.create().text("Set!").build();
bt.setOnAction(new EventHandler() {
@Override
public void handle(Event t) {
System.out.println("Color : " + Color.web(colorTf.getText()));
testedColorPicker.setValue(Color.web(colorTf.getText()));
System.out.println(testedColorPicker.getValue());
}
});
hb.getChildren().addAll(lb, colorTf, bt);
return hb;
}
private HBox setColorHbox() {
HBox hb = new HBox();
Label lb = new Label("Set color");
final TextField colorTf = TextFieldBuilder.create().prefWidth(100).build();
Button bt = ButtonBuilder.create().text("Set!").build();
bt.setOnAction(new EventHandler() {
@Override
public void handle(Event t) {
System.out.println("Color : " + Color.web(colorTf.getText()));
testedColorPicker.setColor(Color.web(colorTf.getText()));
System.out.println(testedColorPicker.getColor());
}
});
hb.getChildren().addAll(lb, colorTf, bt);
return hb;
}
}
If I type "aaaaaa" in any of textFields, I don't see affecting of the setters. (getters work, but control doesn't change image)