-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to center paragraph. #548
Comments
That looks correct. Have you examined it with Scenic View?
…On Jul 27, 2017 4:10 PM, "Patrick Dattilio" ***@***.***> wrote:
I have an InlineCssTextArea where I append a line of text and then attempt
to center the entire paragraph. I've tried setting the setParagraphStyle
and setStyle, but neither seems to work. I've attached a sample that
shows the behavior, any ideas where I might be going wrong?
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
import org.fxmisc.richtext.InlineCssTextArea;
public class Example extends Application {
public static void main(String args[]){
launch(Example.class);
}
@OverRide
public void start(Stage primaryStage) throws Exception {
GridPane root = new GridPane();
Scene scene = new Scene(root, 900.0,900.0);
InlineCssTextArea area = new InlineCssTextArea();
root.add(area, 0, 5, 4, 1);
primaryStage.setTitle("Example");
primaryStage.setScene(scene);
primaryStage.show();
area.appendText("Test");
area.setParagraphStyle(area.getCurrentParagraph(), "-fx-text-align: center;");
area.setStyle(area.getCurrentParagraph(), "-fx-text-align: center;");
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#548>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIBfbabQ6LMjbf48qBhlB5a5F-2mola-ks5sSUMygaJpZM4OmDCn>
.
|
Yes, the style appears to be set on both the |
Hmm... strange.
Also, which version are you using?
…On Jul 27, 2017 6:19 PM, "Patrick Dattilio" ***@***.***> wrote:
Yes, the style appears to be set on both the TextExt and the ParagraphText
but "Test" remains left aligned.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#548 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIBfbQ0DTyFDM7MpYyqkRwkfPjW-kKWSks5sSWFogaJpZM4OmDCn>
.
|
"-fx-text-align" -> "-fx-text-alignment". Simple typo. Sorry about that! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an InlineCssTextArea where I append a line of text and then attempt to center the entire paragraph. I've tried setting the
setParagraphStyle
andsetStyle
, but neither seems to work. I've attached a sample that shows the behavior, any ideas where I might be going wrong?The text was updated successfully, but these errors were encountered: