Is there a way to adjust the Brightness of the current Scene ?
I tried this solution: Change brightness of whole scene but this is not working for me.
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
VBox parent = new VBox();
parent.getChildren().add(new Label("Examples"));
HBox urlArea = new HBox(new Label("Text:"));
TextField textField = new TextField();
urlArea.getChildren().add(textField);
parent.getChildren().add(urlArea);
Button button = new Button("Count Words");
button.setOnAction(event -> {
if (textField.getText().isEmpty()) {
System.err.println("TextField is Empty!");
} else {
System.out.println(counter(textField.getText()));
}
});
parent.getChildren().add(button);
// Possible Fix from StackOverflow
// Sadly no changes
Label fix = new Label("Fix colorAdjust whole scene.");
fix.setVisible(false);
fix.setManaged(false);
// Change Brightness of Scene
// Not Working. But i can see slight differents in the letters
ColorAdjust setBrightness = new ColorAdjust();
Button buttonBrightness = new Button("Brightness 0.1");
buttonBrightness.setOnAction(event -> {
setBrightness.setBrightness(0);
parent.setEffect(setBrightness);
});
parent.getChildren().add(buttonBrightness);
primaryStage.setScene(new Scene(parent));
primaryStage.setTitle("Testing Frame");
primaryStage.setHeight(200.0);
primaryStage.setWidth(200.0);
primaryStage.setResizable(false);
primaryStage.show();
public static void main(String[] args) {
launch(args);
}
}
Im totaly new to JavaFx and this is my test area.