我不想将整个文本区域设置为粗体,而只是将选定的一行设置为粗体。怎么做呢?
最佳答案
我建议改用 JTextPane,因为有针对它的示例解决方案: http://docs.oracle.com/javase/tutorial/uiswing/components/editorpane.html http://www.java2s.com/Code/Java/Swing-JFC/JTextPaneStylesExample6.htm
关于java - 在 JTextArea 中将字符串设置为粗体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16226653/