简体   繁体   中英

How can I align the text in JTextArea in java gui swing

如何在Java swing中对齐文本区域中的文本,是否有此属性以及如何设置?

This should work out:

JTextArea jTextArea = new JTextArea();
jTextArea.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); 

(credit to Braj for this answer).

Also, this should give you more information: How to set the orientation of JTextArea from right to left (inside JOptionPane)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM