
尝试使用
JEditorPane或
JTextPane代替
Jtextarea。
有关更多信息,请查看此线程在JEditorPane中的文本垂直对齐
样例代码:
JTextPane output = new JTextPane();SimpleAttributeSet attribs = new SimpleAttributeSet();StyleConstants.setAlignment(attribs, StyleConstants.ALIGN_RIGHT);output.setParagraphAttributes(attribs, true);
编辑
你可以试试
Jtextarea jtextarea = new Jtextarea();jtextarea.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)