Justificar un texto en un JEditorPane

carlos777
12 de Abril del 2004
Hola, tengo un string que es un texto, y me gustaria que apareciera justificado. Para ello le meto las etiquetas de html, y le pongo para que salga justificado y lo que hace es salirme el texto centrado. Esto es lo que hago:

String tags = "<html><head></head><body style="text-align: justify"><font face="Times New Roman" color="black" style="font-size: 14pt"><p>&nbsp;&nbsp;&nbsp;&nbsp;";
tags += texto;
texto = tags;
texto = texto.replaceAll("n","<br>&nbsp;&nbsp;&nbsp;&nbsp;");
texto += "</p></font></body></html>";

editorPane = new JEditorPane( "text/html",texto);

Si alguien me podria ayudar...incluso no me importa cambiar el JEditorPane por otro componente de texto. Un saludo y gracias