public BasicView(String name) {
super(name);
Button b = new Button("test test test");
this.getChildren().addAll(b);
width = MobileApplication.getInstance().getScreenWidth();
height = MobileApplication.getInstance().getScreenHeight();
VBox box = new VBox();
box.getChildren().add(b);
setCenter(box);
Text t = new Text(width/4,height/2,"OMG ITS TEXT ON THE SCREEN !!!! TEST TEST TEST TEST");
t.setWrappingWidth(100);
this.getChildren().add(t);
b.setOnAction(e -> this.rotate(t));
TextFlow tf = new TextFlow();
Text t1= new Text("This text is not bold ");
Text t2= new Text(",this part is,");
t2.setStyle("-fx-font-weight: bold");
t2.setFill(Color.RED);
Text t3= new Text("and this part is italic");
t3.setStyle("-fx-font-style: italic");
tf.setPrefSize(30,30);
tf.setMaxWidth(USE_PREF_SIZE);
tf.getChildren().addAll(t1,t2,t3);
tf.setStyle("-fx-background-color: red");
tf.setLayoutX(100);
tf.setLayoutY(100);
this.getChildren().addAll(tf);
}
JavaFX TextFlow ignorant attribué la couleur et la taille arrière-plan
le flux de texte qui en résulte n'enveloppez et n'a pas aucune couleur d'arrière-plan. la partie t3 du texte n'est pas non plus affichée en italique. J'ai essayé de chercher des réponses mais je n'ai rien trouvé. toute aide serait grandement appréciée.
EDIT: J'ai oublié de mentionner que j'utilise le plugin mobile gluon pour construire une application Android en utilisant javaFx.
Cela a fonctionné, je vous remercie. Je n'étais pas au courant qu'il s'étendait BorderPane, je l'avais supposé étendu Pane (aurait dû vérifier). – Jonathan