JTextArea txt = new JTextArea(); StringBuffer sb = new StringBuffer(); sb.append(\"Employee Information\"); sb.append(\"\\n\"); sb.append(\"Name:\");
You can use the setFont method. For your example try :
setFont
Font font = txt.getFont(); txt.setFont(font.deriveFont(Font.BOLD));
(Keep in mind that txt is the JTextArea, not your actual text.)
txt
JTextArea