Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to center a TextArea

jayloganFeb 8 2014 — edited Feb 10 2014

I have a JavaFX non-editable TextArea that I use to display info. I do so because I want the text to automatically wrap the text that can sometimes be long.

However, I cannot get the text to be centered. The CSS style

-fx-text-alignment: center

works for Text objects, not TextArea objects.

Does anyone know how to center the text in a non-editable TextArea? Should I use an alternative control to display my information instead?         

Thank you

This post has been answered by James_D on Feb 10 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2014
Added on Feb 8 2014
4 comments
4,011 views