 <p>The easiest way to do this, is to get the StyledDocument from the JTextPane, and to use the setCharacterAttributes() method.</p> <p>The setCharacterAttributes method on the StyledDocument object allows you to set for a specific character range, a set of attributes, which can include BOLD.</p> <p>See the <a href="http://download.oracle.com/javase/1,5.0/docs/api/javax/swing/text/StyledDocument.html#setCharacterAttributes%28int,%20int,%20javax.swing.text.AttributeSet,%20boolean%29">Javadoc for more info</a></p> <p>Some sample code could be</p> <pre><code>// set chars 4 to 10 to Bold SimpleAttributeSet sas = new SimpleAttributeSet(); StyleConstants.setBold(sas, true); textPane.getStyledDocument().setCharacterAttributes(4, 6, sas, false); </code></pre>