2
JTextArea txt = new JTextArea();
StringBuffer sb = new StringBuffer();
sb.append("Employee Information");
sb.append("\n");
sb.append("Name:");
txt.setText(sb.toString());
在這裏,我需要設置「員工信息」大膽format..How做到這一點.. 我想這樣如何在JTextArea中設置風格(使粗體)文本?
sb.append("<html><b>Employee Information</b></html>");
但其打印文本通常...如何大膽?
http://stackoverflow.com/questions/2713863/java-jtextarea-bold – 2011-12-15 05:24:45
我嘗試.. JEditorPane textarea =新的JEditorPane(「文本/ HTML」,「」); textarea.setText(「Here is bold text」); sb.append(「員工信息」); sb.append(「\ n」); sb.append(「Name:」); textArea.setText(sb.toString());但它沒有來.. – shree
感謝我得到它..它工作... – shree