2
Thanks to devsundar我找到了如何在JEditorPane
加粗/下划线/斜体/不管怎么做。我如何设置JEditorPane
中所选文字的Font Size
?Java - 在JEditorPane中设置选择的字体大小?
我对不断变化的粗体/斜体/等当前的方法:
AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY,
StyleConstants.StrikeThrough, true);
pane.getStyledDocument().setCharacterAttributes(pane.getSelectionStart(),
pane.getSelectionEnd(), aset, true);
我确实需要按钮添加到我的GUI,所以这将工作!谢谢! – Primm
优秀;另见'HTMLDocumentEditor',在[这里]提到(http://stackoverflow.com/a/10160836/230513)。 – trashgod