java - html in JTextPane - strange box appear for tags -


i haven't used html in jtextpane before , playing today. come across strange output.

here simple code, htmlstr contains contains tag <aa> :

public class htmlinjtextpanetest extends jframe {     private jtextpane jtp;     private string htmlstr= "<html><body><b>what this</b> <aa > ?? </body></html>";     public htmlinjtextpanetest() {         jtp = new jtextpane();         jtp.setcontenttype("text/html");         jtp.settext(htmlstr);         //jtp.seteditable(false);          //jframe setup         add(jtp);         setdefaultcloseoperation(jframe.exit_on_close);         setsize(200, 100);         setvisible(true);     }     public static void main(string[] args) {         new htmlinjtextpanetest();     } } 

the output of :

enter image description here

i don't know why box (seems input field) appeared tag name aa in it?

it disappears when set editable false on jtextpane object jtp.

    jtp.seteditable(false); 

can please explain it?

you can use http://java-sl.com/custom_tag_html_kit.html example of custom tag support in htmleditorkit.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -