TextPan Bold
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
StyledDocument doc = textPane.getStyledDocument();
int start = textPane.getSelectionStart();
int end = textPane.getSelectionEnd();
Style style = textPane.addStyle("BoldStyle", null);
StyleConstants.setBold(style, true);
doc.setCharacterAttributes(start, end - start, style, false);
}
Comments
Post a Comment