Have you tried adding quotation marks around the string you're printing? Remeber to escape the quotes you're using as part of your string;

textPane.setText("<span style=\"font-size:...