B4J Question Changing text alignment for JavaFX dialog box

MegatenFreak

Active Member
Licensed User
Hello.
I'm trying to set the alignment to right (or orientation right-to-left) in a JavaFX modal dialog, so the Farsi text is aligned to the right side of the dialog box instead of the left. I tried using CSS:
B4X:
.dialog-pane {
    -fx-background-color: black;
    -fx-text-alignment: right;
}
.dialog-pane .label {
    -fx-text-fill: yellow;
    -fx-text-alignment: right;
}
The color and fill commands work, but the alignment doesn't. I realized I need to set the orientation to RIGHT-TO-LEFT. Searching further, I found a solution in javafx forums that suggested the following code be run:
B4X:
alert.getDialogPane().setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
But I have no idea how to make that happen in B4J...
Please help.
 

Similar Threads

Top