0
如何更改JTextPane和中心文本的字體。 我試着用textPane.setFont(font);但後來我不能文本居中,我試圖用如何更改JTextPane(JTextArea)字體和對齊方式?
SimpleAttributeSet attribs = new SimpleAttributeSet();
StyleConstants.setAlignment(attribs , StyleConstants.ALIGN_CENTER);
,但後來我不能改變字體...
看一看這個[ (http://stackoverflow.com/questions/6949125/font-of-a-styleddocument-associated-with-a-jtextpane)或這[一](http://stackoverflow.com/questions/10585956/jtextpane - 如何到組最字體大小)... – aymeric