Aligning text within a JTextArea

P

Phillip

How can text be aligned within a JTextArea? The Java documentation
shows a 'setHorizontalAlignment()' method for a JTextField, but not
for a JTextArea. I tried 'setHorizontalX(0)' with no luck.

Phillip
 
A

Andrew Thompson

|
| How can text be aligned within a JTextArea? The Java
documentation
| shows a 'setHorizontalAlignment()' method for a JTextField,
but not
| for a JTextArea. I tried 'setHorizontalX(0)' with no luck.

You could achieve centered text if you
put html in a JEditorPane, but I suspect
there might be better answers forthcoming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top