How to stylize (make bold) text in a JTextArea?

前端 未结 2 1373
挽巷
挽巷 2021-01-22 21:41
JTextArea txt = new JTextArea();
    StringBuffer sb = new StringBuffer();
    sb.append(\"Employee Information\");
    sb.append(\"\\n\");
    sb.append(\"Name:\");
            


        
2条回答
  •  深忆病人
    2021-01-22 22:35

    The JText Area is a plain text area, for styled text areas you need something like JEditorPane or JTextPane, take a look at the Documentation

提交回复
热议问题