Hi.
I want to disable javafx.scene.text.Text in a Scene. These texts are contained in a TextFlow.
However, the Texts are not displayed as disabled (unlike Label). If I add javafx.scene.control.Label to the TextFlow instead, they are displayed gray (disabled).
How can I achieve the same visual representation with Texts (displaying it gray / opaque, when disabled)?
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.stage.Stage;
public class TestApp extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
TextFlow textFlow = new TextFlow();
textFlow.getChildren().add(new Text("test"));
textFlow.disableProperty().set(true);
Scene scene = new Scene(textFlow);
stage.setScene(scene);
stage.show();
}
}